core_calendar_create_calendar_events
This function is used to create new calendar events. You can create events for a user, a course, or a group.
Let's review the POST parameters for this function:
- Required Parameters:
events[0][name]
= string (Required: The title of the calendar event.)events[0][timestart]
= int (Required: The start time for the event, formatted as a Unix timestamp.)
- Optional Parameters:
events[0][description]
= string (Optional: A detailed description of the event.)events[0][eventtype]
= string (Optional: The context of the event. Can be 'user', 'course', 'group', 'site', or 'category'. Defaults to 'user'.)events[0][courseid]
= int (Optional: The ID of the course this event is associated with. Required if eventtype is 'course'.)events[0][timeduration]
= int (Optional: The duration of the event in seconds. If 0, the event is considered to have no end time.)events[0][repeats]
= int (Optional: The number of times the event repeats.)
cURL Command Example (Creating a Calendar Event):
core_calendar_delete_calendar_events
This function is used to delete one or more calendar events using their unique event ID.
Let's review the POST parameters for this function:
- Required Parameter:
events[0][eventid]
= int (Required: The unique ID of the calendar event to delete.)
- Optional Parameter:
events[0][repeat]
= int (Optional: Set to 1 to delete all occurrences of a repeating event, or 0 to delete only this specific instance. Defaults to 0.)
cURL Command Example (Deleting a Calendar Event):