PUT /events
Description
Updates data on an event
The route handles the PUT request made to the /events/{id}
path.
HTTP method | Route | Query parameters |
---|---|---|
PUT | /events | id |
Query parameters
The next parameter is sent in the request line:
Name | Type | Description |
---|---|---|
id | number | Required. The ID of the event to be updated. |
Payload
The server expects to receive a json object with the next properties (both unchanged and modified properties are needed):
Name | Type | Description |
---|---|---|
text | string | Required. The name of the event to be updated. |
start_date | string | Required. The event start date in the ISO format yyyy-MM-dd'T'HH:mm:ss.SSSXXX |
end_date | string | Required. The event end date in the ISO format yyyy-MM-dd'T'HH:mm:ss.SSSXXX |
allDay | boolean | Optional. Enables/disables the event duration throughout the day. |
type | number | Required. The calendar ID which is the event type. |
details | string | Optional. Details about the event. |
files | object | Optional. An array of the files to be attached to the event. You can attach files that are already uploaded to the server. The file object should contain the file id, name, and url. |
Example:
{
"text": "My Event",
"start_date": "2022-07-10T03:05:00.369Z",
"end_date": "2022-08-10T10:10:00.369Z",
"allDay": true,
"type": 1,
"details": "Some details",
"files": [
{
"id": 2,
"name": "test.txt",
"url": "https://docs.dhtmlx.com/event-calendar-backend/uploads/2/test.txt"
}
]
}
Response
No data is returned back. The HTTP status code shows whether the request succeeds (response.status == 200) or fails (response.status == 500).
Related articles: