POST ./calendars/event
Need subscription flag (for student/parent): FLAG_CAL_MEMENTO
Add new event and create recurrence sessions by selected options.
The parameter dateType can have the following values:
- 1 - hourly (only parameter dataStart is mandatory)
- 2 - all day
The parameter recurrenceType can have the following values:
- 1 - daily
- 2 - weekly
- 3 - monthly
The parameter day it depends on recurrenceType:
- 1 (daily) - not used
- 2 (weekly) - Can be from 1 to 7 (1-Monday, 2-Tuesday, etc)
- 3 (monthly) - Can be form 1 to 32 (1-31 day of the month, 32-special number for the last day of the month)
POST parameters
Name | Value Type | Validation | Details |
---|---|---|---|
name | string | Required | min_length[3]; Event name. |
description | string | Optional | Event description. |
style | string | Required | Select one values from the predefined list with styles (ex: event-style2). |
dateType | int | Required | values[1,2]; Select hourly or all day option. |
recurrenceType | int | Optional | values[1,2,3];Used for recurrence to create many sessions. |
day | int | Optional | less_than_equal_to[7] / less_than_equal_to[32]; Depends on recurrenceType |
startDate | string | Required | rfc_date; We starting from this date. |
endDate | string | Required | rfc_date; The end date. |
startHour | string | Required | Start hour (H:i). Not required when dateType = 2 (all day). |
endHour | string | Required | End hour (H:i). Not required when dateType = 2 (all day). |
Validation
Error Field | Error Code | Error Message |
---|---|---|
startDate, endDate | 102 | The date in invalid. |
startDate | 103 | The date is past OR invalid. |
endDate | 104 | The end date must be higher than start date. |
startHour, endHour | 105 | The hour format is invalid. |
endHour | 106 | The end hour must higher than start hour. |
Output example
{"ceID": 12}