Users

Users

This section of the documentation covers user-related endpoints in the Scheduler API. Users can log in, create accounts, update their information, reset their passwords, and retrieve user events.

User Login

Endpoint: /users/login

  • Method: POST
  • Description: Log in with a registered email and password.
  • Authentication Required: No

To log in, send a POST request with the following JSON payload:

Request Body (JSON):

{
  "email": "user@example.com",
  "password": "securepassword123" // Must be 16 characters long
}

Create a New User

Endpoint: /users/create

  • Method: POST
  • Description: Create a new user account with the provided details.
  • Authentication Required: No

To create a new user, send a POST request with the following JSON payload:

Request Body (JSON):

{
  "email": "user@example.com",
  "password": "securepassword123", // Must be 16 characters long
  "firstName": "John", // Must be 6-25 characters long
  "lastName": "Doe" // Must be 6-25 characters long
}

Update User Information

Endpoint: /users/update

  • Method: PUT
  • Description: Update user information such as first name and last name.
  • Authentication Required: Yes (Bearer Token)

To update a user, send a PUT request with the following JSON payload:

Request Headers: Authorization: Bearer YOUR_ACCESS_TOKEN

Request Body (JSON):

{
  "firstName": "NewFirstName", // Must be 6-25 characters long
  "lastName": "NewLastName" // Must be 6-25 characters long
}

Reset User Password

Endpoint: /users/reset-password

  • Method: PUT
  • Description: Reset a user's password with the provided old and new passwords.
  • Authentication Required: Yes (Bearer Token)

To reset a user password, send a PUT request with the following JSON payload:

Request Headers: Authorization: Bearer YOUR_ACCESS_TOKEN

Request Body (JSON):

{
  "email": "user@example.com",
  "oldPassword": "oldpassword123", // Must be 16 characters long
  "newPassword": "newpassword123" // Must be 16 characters long
}

Get All User Events

Endpoint: /users/events

  • Method: GET
  • Description: Retrieve all events associated with the user.
  • Authentication Required: Yes (Bearer Token)

To retrieve all events of user, send a GET request with the following:

Request Headers: Authorization: Bearer YOUR_ACCESS_TOKEN