Scott_Crockford | 2020-11-11 22:24:28 UTC | #1
When calling the WorkforceManagementApi.PostWorkforcemanagementBusinessunitWeekScheduleAgentschedulesQuery the following exception is thrown:
PureCloudPlatform.Client.V2.Client.ApiException: Error calling PostWorkforcemanagementBusinessunitWeekScheduleAgentschedulesQuery: {"message":"Date-only values must be specified using a four digit year and two digit month and day in the format yyyy-MM-dd","code":"invalid.local.date","status":400} at PureCloudPlatform.Client.V2.Api.WorkforceManagementApi.PostWorkforcemanagementBusinessunitWeekScheduleAgentschedulesQueryWithHttpInfo(String businessUnitId, Nullable1 weekId, String scheduleId, BuQueryAgentSchedulesRequest body, Nullable1 forceAsync, Nullable1 forceDownloadService) at PureCloudPlatform.Client.V2.Api.WorkforceManagementApi.PostWorkforcemanagementBusinessunitWeekScheduleAgentschedulesQuery(String businessUnitId, Nullable1 weekId, String scheduleId, BuQueryAgentSchedulesRequest body, Nullable1 forceAsync, Nullable1 forceDownloadService)
It appears the SDK is not sending the correct date format in the request.
John_Carnell | 2020-11-12 01:51:27 UTC | #2
Hi Scott,
I would encourage you first to double-check that you are passing in the correct date string. I checked our logs over the last three days and I saw several calls coming to from a RestSharp client where:
- The data was embedded directly in the URL rather than being passed into the call as a query parameter.
- The data format had a date-time stamped being appended to it.
I really can't tell if that call is yours but it does look suspicious and so I would encourage you to double-check your string. If you want to post the code snippet here that might help me narrow things down.
If you are positive that your date string is correct, I would then open a ticket with our Care team. To open a ticket look here. Our SDKs are generated off the swagger documents definitions. The swagger docs indicate that this value is passed as a string and so the SDK would just forward it onto the service team's API. Not saying it couldn't be a problem with the SDK, but usually, these problems are with the downstream service.
So if you open a ticket with support, the ticket will be passed onto the appropriate service team.
Hope that helps.
John Carnell Manager, Developer Engagement
Scott_Crockford | 2020-11-12 13:24:05 UTC | #3
Hello,
The method in the .Net SDK takes a DateTime? parameter and not a string. It is the SDK that is creating the string format.
I can make the API call without using the SDK. I am just reporting an issue with the SDK.
John_Carnell | 2020-11-12 14:15:19 UTC | #4
Hi Scott,
I apologize you are absolutely right. I was looking at the swagger definition only when I wrote this email. I did not look at the SDK. I will definitely open up a ticket within my own team and have someone take a look at it. (My teams own the SDK generation process) In the meantime, if this blocking you I would recommend you call the API directly. It's not optimal, but it can keep you moving forward while we figure this out.
Thanks for working with me on this and bringing it to our attention. John Carnell Manager, Developer Engagement.
John_Carnell | 2020-11-12 15:20:04 UTC | #5
Hi Scott,
Just a follow-up. We did identify the issue to be how we are serializing dates within our .NET SDK generation process. I am going to open this as a high priority ticket and get someone to look at it. I do not have an idea of the fix yet.
Thanks, John Carnell Manager, Developer Engagement
Scott_Crockford | 2020-11-12 15:36:46 UTC | #6
Thank You John.
system | 2020-12-13 15:36:51 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: 9293