List Company Activities

An overview of the List Company Topics endpoint.

Endpoint Description

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

HTTP Method

GET /api/v2/companies/activities

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 activities. 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/activities?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 activities 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:

  • activity_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.

    • topic_name (string): The name of the topic

    • activity_list (object): The package of activities tied to the topic

      • id (integer): The unique id of the topic activity.

      • name (string): The name of the topic activity.

      • type (string): The type of activity

        • sorting_cards: This indicates it's an 'Identify' or Pyramid activity

        • overview: This indicates its an Explore activity

    • activity_url (string): The URL to access the topic activity via an iFrame.

Response Examples

{
    "meta": {
        "total_items": 4,
        "total_pages": 1,
        "current_page": "1",
        "per_page": "50"
    },
    "data": [
        {
            "company_id": 3124,
            "activity_list": [
                {
                    "topic_id": 123,
                    "topic_name": "Stages of Change (SUD)",
                    "activities": [
                        {
                            "id": 71,
                            "name": "Identify My Stage of Change",
                            "type": "sorting_cards",
                            "activity_url": "http://discover.r1learning.com/activity****"
                        },
                        {
                            "id": 98,
                            "name": "Explore the Stages of Change Model",
                            "type": "overview_definition_cards",
                            "activity_url": "http://discover.r1learning.com/activity****"
                        }
                    ]
                },
                {
                    "topic_id": 242,
                    "topic_name": "Phases of Addiction",
                    "activities": [
                        {
                            "id": 27,
                            "name": "Identify My Phase of Addiction",
                            "type": "sorting_cards",
                            "activity_url": "http://discover.r1learning.com/activity****"
                        },
                        {
                            "id": 63,
                            "name": "Explore the Phases of Addiction Model",
                            "type": "overview_definition_cards",
                            "activity_url": "http://discover.r1learning.com/activity****"
                        }
                    ]
                }
            ]
        }
    ]
} 
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