List Company Programs
An overview of the List Company Programs endpoint.
Endpoint Description
The List Company Programs endpoint provides the list of programs associated for a specific company setup within R1 Discover. This information is used for user and administrator alignments, this is important for reporting, setting permissions, and aligning curriculum.
HTTP Method
GET /api/v2/programs/{companyId}
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.
URL Parameters
companyId (integer, required): The id of the company (subscription) to query Program data. Inputting 0 will return program data for all companies accessible by your bearer token. Example: 0
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
programOrder (Integer, Required): Specifies the order the programs should be returned in:
1 - Sort by Oldest Location ID
2 - Sort by Newest Location ID
3 - Sort Alphabetically by Location Name
4 - Sort Reverse Alphabetically by Location Name
Request Examples
curl --request GET \
--get "https://api.r1learning.com/api/v2/programs/0?page=1&limit=50&sortby=1&programOrder=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 programs 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:
company_id (Integer): The unique identifier for the company within the R1 Discover system.
programs (object): The package of the specified company locations
program_id (integer): Unique identifier for each program.
program_name (string): Name of the program.
program_parent_id (integer): The id of the program parent. Each program is mapped to a parent, this enables better tracking of high level programs (i.e. ASAM Detox/Residential LOCs, training programs that will have smaller cohorts, etc...)
program_parent_name (string): The name of the program parent.
status (string): The status of the program (published, pending, draft)
Response Examples
{
"meta": {
"total_items": 2,
"total_pages": 1,
"current_page": 1,
"per_page": 50
},
"program_list": [
{
"company_id": 1432,
"programs": [
{
"program_id": 1937,
"program_name": "Detox",
"program_parent_id": 1,
"program_parent_name": "ASAM Level .5 – Early Intervention",
"status": "published"
},
{
"program_id": 4526,
"program_name": "PHP",
"program_parent_id": 4,
"program_parent_name": "ASAM Level 2.5 – Partial Hospitalization",
"status": "published"
}
]
}
]
}
Postman Link
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