User's schedule "doesn't match what's in Genesys"?

Good morning, hope you all had a great weekend. :smiley:

So, I got a weird bug report on Friday, and as usual, I'm a bit baffled. With so many APIs, I'm sure I'm either calling the wrong one or missing a parameter or something stupid-simple. So my process so far is as follows:

  1. Get the current user's schedule using (POST) /api/v2/workforcemanagement/agentschedules/mine. The parameters are start and end dates in ISO 8601 format (for example, in API Explorer I passed it { "startDate": "2023-07-28T00:00:00.000Z", "endDate": "2023-07-29T00:00:00.000Z" }).
  2. This gives me n array of objects, each with "startDate", "lengthMinutes", "description" (always blank), "activityCodeId". Now these "activity codes" are the first element of weird and mysterious. The docs don't really explain what they're for, but with some trial'n'error, I found an API endpoint (I don't recall which) that translates them to statuses (presence-type, not routing-type). So my code calls that once and gives me a list of the numeric "activity codes" and the corresponding statuses ("presences"). Usually (though this user found one that didn't) my code can find a status for every "activity code", so this works out well. In general. :smiley:
  3. And at that point, the software has the user's schedule in a format both it and the user can understand. So we have a schedule screen with a table, a widget that reminds them when their schedule is about to change, and cool stuff like that.

Now, I've been over the SDK docs, I've been back to the API Explorer, I've looked at the Genesys GUI, and all I really know for sure is I don't have the whole picture.

  • For one thing, it says I'm working on Saturday and Sunday, which is weird. This is the closest I've been able to come to reproducing the issue personally. Now granted, this could just be how our admin did my schedule - he may have just assumed that I may have to work after-hours (and he wouldn't be wrong on that :laughing:). But the user who reported the bug also said hers did that. So I looked in Genesys, and it was strange: my schedule did in fact show me as working on Saturday/Sunday, but it was grayed out. How did Genesys know not to gray it out? Probably another API endpoint someplace...?
  • Went over some logs, and found this in a few places: "Entity not found: name = BusinessUnit, id = mine". Now I remember during the early stages of development, I had code reaching out to something about "business units" (another element of dark mystery with minimal info in the docs); that code is no longer in place since I found the WorkForceManagementAPI.getMySchedule or whatever it was called :laughing:) but I suspect that might potentially be a possibility somehow...
  • I tried viewing the Network tab in the default Genesys GUI, but there were no Genesys API calls - only something called "bam.nr-data.net". Now I know the Genesys GUI reaches out to other places besides the API, so I'm guessing this is somebody else's integration or something unrelated... so it's not like I could get any additional insight that way.

So...

  • Do I need to get the ID I got from "publishedSchedules" and send that someplace?
  • Is there some kind of "ScheduleExceptionsAPI" or "ScheduleAlterationsAPI" or "WorkForceManagement.GetWhichDaysImWorkingAPI" or something?
  • If I'm calling the correct API endpoint, ould it be that I'm missing a parameter or two (or ten :laughing: )?
  • Is there anything that sounds obviously "off" about how I'm doing things? Maybe some of you who have been using this API for a long time will spot a silly mistake I made somewhere. I do think either Business Units or Activity Codes - the two wild cards in my current algorithm - might be the culprit somehow.

idk, it's Monday. Could be Monday-brain talking too. :laughing: But as always, any additional info would be greatly appreciated.

Hey thanks for reaching out. There's a lot here so I think the best thing would be to try to answer in an overview sense.

An activity code is something that is used in a schedule. It is not directly tied to presence, though is directly related by category and can be configured to be tied to specific secondary presences. An "activity" is a portion of a shift, and is tied to an activity code. You can find documentation on the route to fetch activity codes here.

There is also a tutorial here that might also be helpful in understanding how schedules work:

Sorry for the late reply. It seems this issue has been resolved, and I just wanted to thank you for helping me get there. Oh, and thanks for the awesome link with tutorials and stuff too! I'm sure that will be a HUGE help going forward.

1 Like

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