RomanSmoll | 2022-04-12 10:40:54 UTC | #1
Hello
We have a question :
we are trying to import (Create a new) schedule in WFM, using the following API https://developer.genesys.cloud/useragentman/workforcemanagement/upload-import-new-schedule.
When testing we used : this as a reference.
The result is that the schedule IS created but it is empty. So all of the parameters are not registered and I assume that the query is ok since it passes the api post.
we also checked here for a refernce but it is not that related.
Therefore here are the questions:
- What is the right api to use in developper tools?
- Why the api call is done through v4? we usually can download the sdk only for v2. what is the difference?
- Why potentially our request does not create a detailed schedule , and creates the empty one instead?
Here is the request: Request:
{
"description": "TestSchedule4",
"weekCount": 1,
"agentSchedules": [
{
"userId": "62748f26-d039-4057-9d52-****",
"shifts": [
{
"activities": [
{
"activityCodeId": "5",
"startDate": "2022-04-07T09:00:00.000+02:00",
"lengthMinutes": 120,
"description": "",
"paid": "false"
}
],
"manuallyEdited":true
}],
"fullDayTimeOffMarkers":[
]
}]
}
Response:
{
"id": "346a1fd6-5d26-44ec-8dd1-****",
"weekDate": "2022-04-04",
"weekCount": 1,
"description": "TestSchedule4",
"published": false,
"metadata": {
"version": 1,
"modifiedBy": {
"id": "87828e0d-3f5b-4693-8d87-****",
"selfUri": "/api/v2/users/87828e0d-3f5b-4693-8d87-****"
},
"dateModified": "2022-04-06T20:56:14.666Z",
"createdBy": {
"id": "87828e0d-3f5b-4693-8d87-****",
"selfUri": "/api/v2/users/87828e0d-3f5b-4693-8d87-*****"
},
"dateCreated": "2022-04-06T20:56:14.666Z"
},
"managementUnits": [],
"selfUri": "/api/v2/workforcemanagement/businessunits/9929e337-d367-4345-b371-****/weeks/2022-04-04/schedules/346a1fd6-5d26-44ec-8dd1-*****"
}
With best regards Roman
brian.trezise | 2022-04-27 09:09:12 UTC | #2
Hi thanks for reaching out! The v4 route you're looking at is actually running through a different service than our public api. Your timing is actually really good as we've just released an entirely new and more streamlined process for importing both short term forecasts and schedules, and for updating existing schedules.
The process for using the old v4 routes is documented in the developer center in the left side bar, but... is deprecated, so you shouldn't use them for new code and any old code is encouraged to migrate to the new process.
The new process uses signed S3 upload urls similar to how we handle downloading large datasets, and the schemas to use are now part of the SDK. In brief:
- Create a signed upload URL with this resource:
POST /api/v2/workforcemanagement/businessunits/{businessUnitId}/weeks/{weekId}/schedules/import/uploadurl
- The schema to use when writing your request body for step 2 is documented on the "response" portion of this route
- PUT your gzipped schedule to the URL returned by step 1, including the headers
- Call this route to tell us you're ready for us to process the data
POST /api/v2/workforcemanagement/businessunits/{businessUnitId}/weeks/{weekId}/schedules/import
The process is identical for importing short term forecasts as well as updating schedules, with the exception that you'll use the resource paths and request schemas specific to those operations.
For completeness: The new resources to update a schedule are POST /api/v2/workforcemanagement/businessunits/{businessUnitId}/weeks/{weekId}/schedules/{scheduleId}/update/uploadurl and POST /api/v2/workforcemanagement/businessunits/{businessUnitId}/weeks/{weekId}/schedules/{scheduleId}/update
and the ones for importing a short term forecast are POST /api/v2/workforcemanagement/businessunits/{businessUnitId}/weeks/{weekDateId}/shorttermforecasts/import/uploadurl and POST /api/v2/workforcemanagement/businessunits/{businessUnitId}/weeks/{weekDateId}/shorttermforecasts/import
RomanSmoll | 2022-04-12 14:45:45 UTC | #3
Hello Brian! Thank you for the reply, especially such a positive one :slight_smile:
We have checked the updated docks and indeed we see the presence of these api in the description. However we instantly ran some tests and we have a few follow up questions:
- are these API available in Dev tools?
- Do we need to update the SDK to get them and use them?
- Do we need to download the new version for Postman ?
- Do we need to carry any changes on Genesys server to activate them?
We have also tried to update the SDK for JS and we are currently on ^125.0.0 . NPM update did not update anything, it said we are up to date and these requests are not there when check for them in the packages. :frowning:
Thank you and once these are clear I will mark it as a solution!
brian.trezise | 2022-04-12 15:42:48 UTC | #4
Answering your questions in order:
- The links I posted are the dev tools links. But those resources are also in the legacy dev tools
- It looks like you're on an old JS sdk version. The latest version is 135.0.0. You can find the latest version here:
https://www.npmjs.com/package/purecloud-platform-client-v2
- If the resources you need are not in postman then yes you can grab the new postman files
- I'm not sure what you're asking here
RomanSmoll | 2022-04-12 15:50:09 UTC | #5
Dear Brian
Thank you very much The last point was regarding whether we need to perform any changes in ADMIN?
With best regards, Roman
brian.trezise | 2022-04-12 15:51:29 UTC | #6
If you mean changes to permissions, no, we are enforcing the same permissions as before
system | 2022-05-13 15:52:07 UTC | #7
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: 14291