List Companies

An overview of the List Companies endpoint.

Endpoint Description

Retrieve a list of all companies within the R1 Discover platform and their R1 Discover IDs

HTTP Method

GET /api/v2/companies

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:

  • 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 "http://r1discoverapi.local/api/v2/companies?page=1&limit=50&orderby=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 companies returned

  • 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:

  • id (Integer): The unique identifier for the company within the R1 Discover system.

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

  • total_licenses (Integer): The total number of licenses available to the company

  • assigned_licenses (Integer): The total number of licenses the company has assigned to accounts

  • license_renewal_date (date): The subscription renewal date for the company licenses.

  • status (string): The subscription status of the company (published, expired)

Response Examples

{
    "meta": {
        "total_items": 2,
        "total_pages": 1,
        "current_page": 1,
        "per_page": 50
    },
    "company_list": [
        {
            "id": 11017,
            "name": "R1 Learning",
            "total_licenses": 200,
            "assigned_licenses": 99,
            "available_licenses": 101,
            "license_renewal_date": "2025-12-31",
            "status": "published"
        },
        {
            "id": 12138,
            "name": "R2 Learning",
            "total_licenses": 100,
            "assigned_licenses": 90,
            "available_licenses": 10,
            "license_renewal_date": "2025-09-30",
            "status": "published"
        }
    ]
}
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