Legacy Dev Forum Posts

 View Only

Sign Up

  • 1.  Importing a New Schedule

    Posted 06-05-2025 18:17

    robert.hostacny | 2020-07-23 14:59:50 UTC | #1

    Hello

    How the import new and/or update existing schedule works from API?

    I'm working on functionality of adding exception "time off" directly to schedule without sending time off request and automatic approve.

    I tried to use method explained here to perform import of schedule with single full day time off in it.

    Request is: {"agentSchedules":[{"userId":"e0c6139e-e87f-44d0-84b9-e652aebecbad","fullDayTimeOffMarkers":[{"businessUnitDate":"2020-07-29","activityCodeId":"5","description":"test add exception to schedule","timeOffRequestId":null,"delete":false,"paid":false,"lengthMinutes":0}],"shifts":null}],"weekCount":1,"description":"No"}

    And got response: {"correlationId":"3d02799d-a32b-4e34-b592-76ac657ea047","files":["59981c39-8d1b-4da7-9f8b-6c7949335816.json.gz"],"operationId":"59981c39-8d1b-4da7-9f8b-6c7949335816"}

    post url HTTP POST https://apps.mypurecloud.com/uploads/v4/services/workforcemanagement/businessunits/c91f6138-209b-4321-bc3e-8c1b7afb9029/weeks/2020-07-27/schedules

    But after checking admin UI for new schedule, nothing is displayed for week starting with 2020-07-27.

    Is there any other steps to take to make the schedule visible in admin UI and published?

    Thank you Best Regards Robert


    Langsford_Jay | 2020-07-24 13:30:47 UTC | #2

    Did you look at the response for the subscription to the v2.workforcemanagement.businessunits.{businessUnitId}.schedules topic for possible issues?

    We looked up the correlation Id and it appears you attempted to submit a 0 duration length and the following was returned in a notification:

    [BadRequest][ValidationFailure][ValueNotInRange]: lengthMinutes: 0 must be between 5 (inclusive) and 1435 (inclusive) Error code: wfm.validation.failure Error key: wfm.validationFailure.valueNotInRange.lengthMinutes


    robert.hostacny | 2020-07-24 13:51:07 UTC | #3

    Hello Jay

    Recently working at Notificationhandler helper to be able to receive notifications from WFM.

    I was thinking that something failed behind the scenes, but was not sure how to get to bottom of it.

    Do you have some code snippet for looking up notifications with correlation id? I believe, it is possible to look into history as well.

    The handler should show notification as it happen in system based on websocket event as far as I understand. But I can't find a solution for looking up events based on correlation ID.

    Thank you br Robert


    tim.smith | 2020-07-24 13:54:05 UTC | #4

    robert.hostacny, post:3, topic:8371
    But I can't find a solution for looking up events based on correlation ID.

    Correlation IDs are only useful when working with Genesys employees as the logging they correspond to is not publicly accessible. If you have ideas for improvements to help you troubleshoot your applications, you can share them at https://purecloud.ideas.aha.io/ideas.


    robert.hostacny | 2020-07-28 12:27:24 UTC | #5

    Hello Tim

    Thank you for the answer. With notification service I was able to update existing schedule.

    I can't update https://purecloud.ideas.aha.io/ideas, because it seems not to be working for me. it says address not available "Unable to load ideas portal".

    I do have another question related to update schedule and Metadata version information. In update request there are metadata required on "UpdateScheduleRequest" level and another metadata is required on "AgentScheduleRequest" level.

    To obtain metadata for "UpdateScheduleRequest" I have to use BuScheduleMetadata result = apiInstance.getWorkforcemanagementBusinessunitWeekSchedule(...)

    and for "AgentScheduleRequest" I have to use BuAsyncAgentSchedulesQueryResponse result1 = apiInstance.postWorkforcemanagementBusinessunitWeekScheduleAgentschedulesQuery(...)

    Isn't there any easier way to fetch all metadata required for update of schedule referenced by id for and particular agent identified by id for specific week?

    Thank you Best Regards Robert


    Drake.Rozenboom | 2020-07-30 15:14:02 UTC | #6

    Hello Robert,

    In regards to your question about the metadata version information, both of those requests are necessary to get the two different metadata versions. There is not a single route that would return both metadata versions.


    robert.hostacny | 2020-07-31 10:27:16 UTC | #7

    Thank you. The approach with reading of schedules works fine ... Moreover for update/delete activity within schedule, I need to read shift. So at the end both requests are required.


    system | 2020-08-31 10:39:24 UTC | #8

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 8371