API Endpoints

An overview of the API Endpoints endpoint.

Endpoint Description

To retrieve the list and details of the endpoints available via the API.

HTTP Method

GET /api/v1/api-endpoints

Headers:

  • Content-Type: application/json - Specifies that the request body format is JSON.

  • Accept: application/json - Indicates that the client expects a JSON response.

  • Authorization: Bearer {token} - A valid Bearer token must be provided to authenticate the request.

URL Parameters:

  • N/A

Data Dictionary:

The response for the "API Endpoints" endpoint contains detailed information about each API available in the system. Below is a breakdown of each field in the response data:

  • data (Array): Collection of data describing the available APIs.

    • name (String): The name of the API.

    • url (Object): Collection of data describing how the API is called.

      • host (String): The primary API site.

      • path (String): The path of the named API.

      • raw (String): The full URL of the API.

    • variable (Array): Collection of data describing the API parameters.

      • id (String): The string ID of the parameter.

      • key (String): The string key of the parameter.

      • value (String): The sample value set up in the API documentation.

      • description (String): The description of the parameter.

    • method (Object): Collection of data describing the header of the API.

      • key (String): The name of the header key.

      • value (String): The description of the header value.

Request Examples

curl --request GET \
    --get "https://api.r1learning.com/api/v1/api-endpoints" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"

Response Examples

{
  "error": 0,
  "message": "",
  "data": [
    {
      "name": "View User Taken Activity Details",
      "request": {
        "url": {
          "host": "https://api.r1learning.com",
          "path": "/api/v1/user-taken-activity-list/:userId/:page/:limit/:maxDays",
          "raw": "https://api.r1learning.com/api/v1/user-taken-activity-list/:userId/:page/:limit/:maxDays",
          "variable": [
            {
              "id": "userId",
              "key": "userId",
              "value": "0",
              "description": "The id of the user."
            },
            {
              "id": "page",
              "key": "page",
              "value": "1",
              "description": "The current page number"
            },
            {
              "id": "limit",
              "key": "limit",
              "value": "50",
              "description": "Number of records you want to get in current request."
            },
            {
              "id": "maxDays",
              "key": "maxDays",
              "value": "10",
              "description": "Get records within these maxDays."
            }
          ]
        },
        "method": "GET",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "key": "Authorization",
            "value": "Bearer {token}"
          }
        ]
      }
    }
  ]
}

Notes

  • Authorization Required: Ensure the provided Bearer token is valid and has sufficient privileges to retrieve the list of API endpoints.

  • Response Handling: Handle responses appropriately to manage data effectively, especially when dealing with a large number of endpoints. Implement pagination if necessary to retrieve the data in manageable chunks.

Last updated