View Company Programs
An overview of the View Company Programs endpoint.
Endpoint Description
The "View Company Programs" endpoint is designed to retrieve a comprehensive list of programs that have been established within a company on the R1 Discover platform. This functionality is used for aligning users and administrators to the appropriate programs and setting permissions.
HTTP Method
GET
/api/v1/view-company-programs/{companyId}/{page}/{limit}
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): The unique identifier for the company, required to specify which company's programs are being queried.
page (integer): The page number in the pagination sequence, helps in retrieving a specific set of results.
limit (integer): The number of records to retrieve per page, aids in controlling the volume of data returned.
Data Dictionary
id (Integer): The unique identifier for the program within the R1 Discover system. This identifier is used internally to reference the program across various API endpoints.
name (String): The name of the program as registered in the R1 Discover system. This name is used for identification and display purposes within the platform.
Request Examples
curl --request GET \
--get "https://api.r1learning.com/api/v1/view-company-programs/1/1/50" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer {token}"const url = new URL(
"https://api.r1learning.com/api/v1/view-company-programs/1/1/50"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.r1learning.com/api/v1/view-company-programs/1/1/50");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer ••••••");
var content = new StringContent(string.Empty);
content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());Response Examples
{
"error": 0,
"message": "",
"companyId": "1",
"page": "1",
"limit": "50",
"data": [
{
"id": 21,
"name": "Test Program"
},
{
"id": 29,
"name": "R1 Sample Program"
},
{
"id": 45,
"name": "Detox New"
}
]
}Notes
Authorization Required: Ensure that the provided Bearer token is valid and has sufficient privileges to access the company programs.
Response Handling: Use pagination to manage data effectively, especially when dealing with large datasets, to enhance performance and usability.
Data Validation: Ensure the provided
companyIdis correct to retrieve the appropriate location details.
Last updated