PutAgentSchedule – malformed syntax

Hi all,
I want to change variable holidays in schedules (eg. Easter Sunday).

When trying to use "PutAgentSchedule", I get the following exception:
Error calling PutArchitectSchedule: {"message":"The request could not be understood by the server due to malformed syntax.","code":"bad.request","status":400,"contextId":"c00865ba-40f5-4879-bdf9-9115f9ffcb14","details":[],"errors":[]}

My code is as follows:
string scheduleId = "49efb9e6-9aca-4feb-a9ad-7a7a1443f88b";
Schedule scheduleBody = new Schedule();
scheduleBody.Name = "EasterSunday";
scheduleBody.Version = 10;
scheduleBody.Start = DateTime.Parse("2022-04-17T00:00:00.000", null, DateTimeStyles.None);
scheduleBody.End = DateTime.Parse("2022-04-17T23:59:59.000", null, DateTimeStyles.None);
scheduleBody.Rrule = "";
var returnedSchedule = architectApi.PutArchitectSchedule(scheduleId, scheduleBody);

According to the documentation (https://developer.genesys.cloud/api/rest/client-libraries/dotnet/Schedule) I filled all mandatory fields, and in addition the version field.

What is the correct syntax?

Thanks for your help!

Could you open a case with Genesys Cloud Care to report that the API resource isn't returning a useful error message? It should be propagating the reason for the invalid request back to you. The fact that it's not should be considered a bug and needs to be handled by Care.

The underlying error is:

Error code [bad.request] type [IllegalArgumentException] message [Invalid format: "2021-08-21T22:00:00Z" is malformed at "Z"] cause type [] cause message []

Per the documentation for the start and end fields:

Date time is represented as an ISO-8601 string without a timezone. For example: yyyy-MM-ddTHH:mm:ss.SSS.

Try using a serializer that doesn't include the timezone component of the timestamp (the Z at the end).

Hi Tim,
when I use another serializer, it works fine!
I opened a case at Genesys Care.
Thanks!

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