How can I create an event with the API?

Hello !

I encounter some issue when I try to create an event by using the API.
The console show this error : code: “caligraph_http_invalid_payload”, message: “Invalid value”, object: “Event”, field: “start”

Here it’s how I put in my code : start:'2021-06-01T13:00:00Z',//string startTimeZone:'Europe/Paris', endTimeZone:'Europe/Paris', end:"2021-06-01T15:00:00Z", title:"test"

Hope someone could help me.

Thanks,
Aladin.

Hi @Aladin The minimum payload for a booking is:

    {
      "startsAt": "2021-01-21T08:00:00",
      "timeZone": "US/Central",
      "units": 1,
      "numberOfSlots": 1,
       "answers" : [
            {"code" : "EMAIL",        "string" : "ben+apitest@testemail.com"},
            {"code" : "FNAME",        "string" : "Ben"},
            {"code" : "LNAME",        "string" : "Test"}
        ]
    }

You will need to pass in all required form fields as well. I hope this helps.

1 Like