APIDocumentation

Draft API endpoint documentation

Price range: €19.22 through €26.22

Endpoint: /api/v1/users/{userId}
Method: GET
Description: Retrieves detailed information about a specific user by their unique identifier (userId).


Request Parameters

  1. Path Parameters:
    • userId (required):
      • Type: String
      • Description: The unique identifier of the user whose information is being requested.
  2. Query Parameters: (optional)
    • includeDetails:
      • Type: Boolean
      • Default: false
      • Description: Specifies whether to include detailed profile data in the response.

Headers

  • Authorization:
    • Type: Bearer Token
    • Description: The access token for authenticating the API request.

Response

  1. Success Response:
    HTTP Status Code: 200 OK
    Response Body:

    json
    {
    "userId": "12345",
    "username": "johndoe",
    "email": "johndoe@example.com",
    "createdAt": "2023-01-01T12:00:00Z",
    "isActive": true,
    "profileDetails": {
    "firstName": "John",
    "lastName": "Doe",
    "phoneNumber": "+123456789",
    "address": "123 Main Street, Springfield"
    }
    }
  2. Error Responses:
    • HTTP Status Code: 401 Unauthorized
      Message: “Invalid or missing authorization token.”
    • HTTP Status Code: 404 Not Found
      Message: “User with the specified ID does not exist.”

Example Usage

Request:

bash
GET /api/v1/users/12345?includeDetails=true HTTP/1.1
Host: api.example.com
Authorization: Bearer <your_access_token>

Response:

json
{
"userId": "12345",
"username": "johndoe",
"email": "johndoe@example.com",
"createdAt": "2023-01-01T12:00:00Z",
"isActive": true,
"profileDetails": {
"firstName": "John",
"lastName": "Doe",
"phoneNumber": "+123456789",
"address": "123 Main Street, Springfield"
}
}

Notes:

  • Ensure the Authorization token is valid and has the necessary permissions.
  • Use the includeDetails parameter judiciously to limit unnecessary payload size.
Select options This product has multiple variants. The options may be chosen on the product page