List Company Topics

An overview of the List Company Topics endpoint.

Endpoint Description

Retrieve a list of all topics that are available to your companies (subscriptions)

HTTP Method

GET /api/v2/companies/topics

Request

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.

Query Parameters:

  • companyId (integer, required): Specify the id of the company (subscription) to pull the list of available topics. Input 0 to pull the data for all companies accessible by your bearer token.

  • page (integer, required): Specifies the page number in the pagination sequence to retrieve a specific set of results.

  • limit (integer, required): Specifies the number of records to retrieve per page, controlling the volume of data returned.

  • sortby (integer, required): Specifies the order the companies should be returned in:

    • 1 - Sort by Oldest Company ID

    • 2 - Sort by Newest Company ID

    • 3 - Sort Alphabetically by Company Name

    • 4 - Sort Reverse Alphabetically by Company Name

Request Examples

curl --request GET \
    --get "https://api.r1learning.com/api/v2/companies/topics?companyId=0&page=1&limit=50&sortby=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"

Response

Meta:

Each List endpoint will contain a meta element which will describe the returned package. In this endpoint, the meta will provide the following information:

  • total_items (Integer): The number of topics returned across all queried companies

  • total pages (integer): The number of pages returned in the call to the endpoint. (Total Items / per_page limit)

  • current_page (integer): Indicates the current page number of the results

  • per_page (integer): Indicates the number of results (topics) that will be listed on a single page. The default is 50, the limit is 100.

Data Dictionary:

  • topic_list: An array of topic objects available to the company.

    • company_id (integer): The identifier for the company.

    • topic_id (integer): A unique identifier for each topic.

    • name (integer): The name of the topic.

    • video_url (string): The URL to access topic-related videos via an iFrame.

Response Examples

{
    "meta": {
        "total_items": 2,
        "total_pages": 1,
        "current_page": "1",
        "per_page": "50"
    },
    "topic_list": [
        {
            "company_id": 17532,
            "topics": [
                {
                    "topic_id": 1123,
                    "name": "Stages of Change (SUD)",
                    "video_url": "http://discover.r1learning.com/video-library/video/****"
                },
                {
                    "topic_id": 3321,
                    "name": "Healthy Boundaries",
                    "video_url": "http://discover.r1learning.com/video-library/video/****"
                }
            ]
        }
    ]
}
Link to the endpoint in Postman

Notes

  • Authorization Required: Ensure the provided Bearer token is valid and has sufficient privileges to access the endpoint.

  • Response Handling: Implement pagination to manage data effectively, especially when dealing with large datasets.

Last updated