API Reference

This section provides a comprehensive guide to the available APIs for interacting with the MSDN platform. Explore the different categories to understand how to integrate our services into your applications.

Authentication APIs

These APIs are used to authenticate users and obtain access tokens required for making requests to other protected endpoints.

POST /oauth/token

POST /oauth/token

Obtains an access token by providing valid credentials.

Parameters:

  • grant_type (string, required): Specifies the grant type (e.g., password, refresh_token).
  • username (string, optional): The user's username (required for password grant type).
  • password (string, optional): The user's password (required for password grant type).
  • refresh_token (string, optional): The refresh token for obtaining a new access token (required for refresh_token grant type).
  • client_id (string, required): The client ID of your application.
  • client_secret (string, required): The client secret of your application.

Returns:

A JSON object containing:

  • access_token (string): The generated access token.
  • token_type (string): The type of token (e.g., Bearer).
  • expires_in (integer): The lifetime of the access token in seconds.
  • refresh_token (string): A token to obtain a new access token when the current one expires.

GET /users/me

GET /users/me

Retrieves the profile information of the currently authenticated user.

Returns:

A JSON object containing user details (e.g., id, username, email, name).

Data Management APIs

Manage your data efficiently with our robust data management APIs. Create, retrieve, update, and delete resources.

POST /items

POST /items

Creates a new item in the system.

Parameters:

  • name (string, required): The name of the item.
  • description (string, optional): A detailed description of the item.
  • quantity (integer, required): The quantity of the item.

Returns:

A JSON object representing the newly created item, including its unique ID.

GET /items/{id}

GET /items/{id}

Retrieves a specific item by its ID.

Parameters:

  • id (string, required): The unique identifier of the item.

Returns:

A JSON object representing the requested item, or a 404 error if not found.

PUT /items/{id}

PUT /items/{id}

Updates an existing item by its ID.

Parameters:

  • id (string, required): The unique identifier of the item to update.
  • name (string, optional): The updated name of the item.
  • description (string, optional): The updated description.
  • quantity (integer, optional): The updated quantity.

Returns:

A JSON object representing the updated item, or a 404 error if not found.

DELETE /items/{id}

DELETE /items/{id}

Deletes an item by its ID.

Parameters:

  • id (string, required): The unique identifier of the item to delete.

Returns:

A 204 No Content status on successful deletion, or a 404 error if not found.

User Profile APIs

Manage user profiles, including personal information and preferences.

GET /users/{userId}/profile

GET /users/{userId}/profile

Retrieves the profile information for a specific user.

Parameters:

  • userId (string, required): The ID of the user whose profile to retrieve.

Returns:

A JSON object containing the user's profile details.

PUT /users/{userId}/profile

PUT /users/{userId}/profile

Updates the profile information for a specific user.

Parameters:

  • userId (string, required): The ID of the user whose profile to update.
  • firstName (string, optional): User's first name.
  • lastName (string, optional): User's last name.
  • bio (string, optional): User's biography.

Returns:

A JSON object representing the updated user profile.

Notifications APIs

Send and manage notifications for your users.

POST /notifications

POST /notifications

Sends a notification to one or more users.

Parameters:

  • userIds (array of strings, required): A list of user IDs to send the notification to.
  • title (string, required): The title of the notification.
  • message (string, required): The content of the notification.
  • priority (string, optional): The priority level (e.g., 'low', 'normal', 'high'). Defaults to 'normal'.

Returns:

A JSON object indicating the success or failure of sending the notifications.

GET /notifications

GET /notifications

Retrieves a list of notifications for the authenticated user.

Returns:

An array of notification objects.

Important: All API requests must include an Authorization header with a valid access token in the format Bearer <your_access_token>.