Create Calendar Events JSON Example Including child_event_data

PaulFoster777
Community Member

Hi,

I'm able to use the create calendar events API for a course without any problems, but when I add child_event_data to my JSON to specify a section I get an error.

Does anyone have an example of how the JSON should be formatted please as I don't understand the relevance of the [X] is in the API notes...calendar_event[child_event_data][X][context_code].

This works...
{"calendar_event":{"context_code":"course_496","title":"Test Course","description":"<strong>Test Course</strong><br><br>Paul Foster","start_at":"2022-06-06T09:00:00","end_at":"2022-06-06T12:00:00","location_name":"Online"}}

This doesn't...
{"calendar_event":{"context_code":"course_496","title":"Test Course","description":"<strong>Test Course</strong><br><br>Paul Foster","start_at":"2022-06-06T09:00:00","end_at":"2022-06-06T12:00:00","location_name":"Online","child_event_data":{"context_code":"course_section_465","start_at":"2022-06-06T09:00:00","end_at":"2022-06-06T12:00:00"}}}

Cheers,

Paul

 

Labels (1)
0 Likes