Events
This section of the documentation covers event-related endpoints in the Scheduler API. You can create events, update event details, retrieve event information, and delete events.
Create an Event
Endpoint: /events/create
- Method: POST
- Description: Create a new event with the provided details.
- Authentication Required: Yes (Bearer Token)
To create a new event, send a POST request with the following JSON payload:
Request Headers: Authorization: Bearer YOUR_ACCESS_TOKEN
Request Body (JSON):
{
"title": "Sample Event", // Must be 1-60 characters long
"description": "A description of the event goes here.", // Must be 1-255 characters long
"start": "2023-12-01T09:00:00Z", // Should be JavaScript Date format
"end": "2023-12-01T17:00:00Z" // Should be JavaScript Date format
}
Update an Event
Endpoint: /events/update
- Method: PUT
- Description: Update an event with the provided details.
- Authentication Required: Yes (Bearer Token)
To update an event, send a PUT request with the following JSON payload:
Request Headers: Authorization: Bearer YOUR_ACCESS_TOKEN
Request Body (JSON):
{
"eventId": "5f8d6b39372de05748bc6f10",
"title": "Updated Event Title", // Must be 1-60 characters long
"description": "Updated event description goes here.", // Must be 1255 characters long
"start": "2023-12-01T10:00:00Z", // Should be JavaScript Date format
"end": "2023-12-01T18:00:00Z" // Should be JavaScript Date format
}
Get Event Information
Endpoint: /events/get/:_id
- Method: GET
- Description: Retrieve event information by event ID.
- Authentication Required: Yes (Bearer Token)
To retrieve information of an event, send a GET request with the following:
Request Headers: Authorization: Bearer YOUR_ACCESS_TOKEN
Delete an Event
Endpoint: /events/delete/:_id
- Method: DELETE
- Description: Delete an event by event ID.
- Authentication Required: Yes (Bearer Token)
To delete an event, send a DELETE request with the following:
Request Headers: Authorization: Bearer YOUR_ACCESS_TOKEN