Legacy Dev Forum Posts

 View Only

Sign Up

PutAgentSchedule – malformed syntax

  • 1.  PutAgentSchedule – malformed syntax

    Posted 06-05-2025 18:06

    Sven_M | 2021-10-04 12:49:13 UTC | #1

    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!


    tim.smith | 2021-10-04 13:19:05 UTC | #2

    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).


    Sven_M | 2021-10-05 09:40:48 UTC | #3

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


    system | 2021-11-05 09:41:32 UTC | #4

    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: 12243