API Documentation

POST /auth/login

Authenticates a user and returns an access token.

Parameters:

  • username (string, required): The user's login name.
  • password (string, required): The user's password.

Success Response (200 OK):

  • token (string): The JWT access token.
  • expires_in (integer): Token expiration time in seconds.

Error Response (401 Unauthorized):

  • error (string): Description of the error (e.g., "Invalid credentials").

GET /data/{resource_id}

Retrieves specific data based on the provided resource ID.

Parameters:

  • resource_id (integer, required): The unique identifier for the data resource.
  • fields (string, optional): Comma-separated list of fields to include in the response.

Success Response (200 OK):

A JSON object containing the requested data.

Error Response (404 Not Found):

  • error (string): Description of the error (e.g., "Resource not found").

PUT /resources/{id}

Updates an existing resource. Requires authentication.

Parameters:

  • id (integer, required): The ID of the resource to update.
  • data (object, required): The updated data for the resource.

Success Response (200 OK):

A JSON object confirming the update, including the updated resource.

Error Response (400 Bad Request):

  • error (string): Description of the error (e.g., "Invalid data format").

Error Response (401 Unauthorized):

  • error (string): Description of the error (e.g., "Authentication required").

POST /notifications/send

Sends a notification to specified users.

Parameters:

  • recipient_ids (array of integer, required): List of user IDs to receive the notification.
  • message (string, required): The content of the notification.
  • priority (string, optional, default: "normal"): Notification priority (e.g., "low", "normal", "high").

Success Response (202 Accepted):

Notification queued for delivery.

Error Response (400 Bad Request):

  • error (string): Description of the error (e.g., "Missing required fields").