API Guide: User Management
An overview of using the R1 Discover APIs for user management.
Introduction
This guide provides detailed instructions for integration partners on how to effectively implement the User Management API endpoints within their applications. By following this guide, partners can ensure a seamless integration process, enabling them to create and manage users within the R1 Discover platform.
Prerequisites
Before beginning the integration process, ensure an R1 Discover Tech Partner account has been created, and you are able to generate your bearer token for authentication.
Detailed instructions on prerequisites can be found here: R1 API: Getting Started
Create User Requirements
When creating a new user in R1 Discover via the API, it is required to include a handful of data elements in addition to a shared unique ID. This guide details the steps to retrieve those elements in support of creating users. As long as locations, programs, practitioners do not change, it may not be require to repeat all steps for each created user.
CompanyID: the ID of the company under which the user will be registered
client_ID: A unique identifier from the integration partner system.
Username: A unique username within the R1 Discover system
Location: The primary location of the user within the company.
Program: The program to which the user is assigned.
Practitioner: The email address of the practitioner aligned to the user.
Status: Indicates whether the user account is active or inactive.
These fields can optionally be included:
email: The email address of the user, STRONGLY RECOMMENDED, but not required. System will return a password in the response if an email is not included, otherwise the password will be emailed to the new user.
initial_password: The initial password for the user account. System will auto-generate if left blank.
company_usename: A specific username tied to the company, if different from the general username. If a company wants their users to a have specific username. Must be unique within the company account, see Check Company Username Availability endpoint.
Similar workflows can be followed to update users, create admins (practitioners), and update admins.
Workflow Overview
Understanding the workflow of accessing the User Management API endpoints is crucial for efficient integration. This section outlines the order in which the endpoints should be accessed to successfully create and manage users.
Step-by-Step User Management Instructions
Generate Bearer Token
Instructions:
Log into R1 Discover Tech Partner Account.
Select the My Companies tab.
Click the Key icon to generate a token.
Copy the token to a secure location. Note that the token will no longer be visible once you leave the page.
Link to Token Generation Documentation: Generate Bearer Token
Retrieve Company ID
Instructions:
Use the Company List Endpoint to retrieve the list of companies and their IDs.
Make a GET request to
https://api.r1learning.com/api/v1/company-list/{page}/{limit}
.Include the Bearer token in the request headers.
Link to Documentation: Company List Endpoint
Validate Locations
Instructions:
Use the View Company Locations Endpoint to retrieve the list of locations for the company.
Make a GET request to
https://api.r1learning.com/api/v1/view-company-locations/{companyId}/{page}/{limit}
.Include the Bearer token in the request headers.
Link to Documentation: View Company Locations Endpoint
Validate Programs
Instructions:
Use the View Company Programs Endpoint to retrieve the list of programs for the company.
Make a GET request to
https://api.r1learning.com/api/v1/view-company-programs/{companyId}/{page}/{limit}
.Include the Bearer token in the request headers.
Link to Documentation: View Company Programs Endpoint
Validate Practitioners
Instructions:
Use the View Company Practitioners Endpoint to retrieve the list of practitioners for the company.
Make a GET request to
https://api.r1learning.com/api/v1/view-company-practitioners/{companyId}/{page}/{limit}
.Include the Bearer token in the request headers.
Link to Documentation: View Company Practitioners Endpoint
Validate Username
Instructions:
Use the Check Global Username Availability to validate the username is available.
Make a GET request to
https://api.r1learning.com/api/v1/users/check-username/global/{username}
.Include the Bearer token in the request headers.
Link to Documentation: Check Global Username Availability
Validate Company Username (Optional)
This is only used if client has requested a company specific login site and credentials for their users.
Instructions:
Use the Check Company Username Availability to validate the username is available.
Make a GET request to
https://api.r1learning.comapi/v1/users/check-username/company/{companyId}/{companyUsername}
.Include the Bearer token in the request headers.
Link to Documentation: Check Company Username Availability
Create User
Instructions:
Use the Create User Endpoint to create a new user.
Make a POST request to
https://api.r1learning.com/api/v1/companies/{companyId}/users
.Include the Bearer token in the request headers.
Provide the required data: Company ID, Shared User ID, Username, Location, Program, Practitioner, Status.
Link to Documentation: Create User Endpoint
Update User
Instructions:
Use the Update User Endpoint to update an existing user.
Make a PUT request to
https://api.r1learning.com/api/v1/companies/{companyId}/users/{clientId}
.Include the Bearer token in the request headers.
Provide the updated data: Company ID, Shared User ID, Username, Email, Location, Program, Practitioner, Status.
Link to Documentation: Update User Endpoint
Create Admin
Instructions:
Use the Create Admin Endpoint to create a new admin.
Make a POST request to
https://api.r1learning.com/api/v1/companies/{companyId}/admins
.Include the Bearer token in the request headers.
Provide the required data: Company ID, Shared Admin ID, Username, email, type, Location, Program, Status.
Link to Documentation: Create Admin Endpoint
Update Admin
Instructions:
Use the Update Admin Endpoint to update an existing user.
Make a PUT request to
https://api.r1learning.com/api/v1/companies/{companyId}/admins/{adminId}
.Include the Bearer token in the request headers.
Provide the updated data: Company ID, Shared Admin ID, Username, Email, Type, Location, Program, Status.
Link to Documentation: Update Admin Endpoint
Last updated