Check Company Username Availability

An overview of the Check Company Username Availability endpoint.

Endpoint Description

The "Check Company Username Availability" endpoint provides the capability to verify if a desired username is available within a specific company on the R1 Discover platform. This allows for the integration of company-specific usernames, ensuring they are unique within the company and possibly synchronized with external system IDs.

HTTP Method:

GET: /api/v1/users/check-username/company/{companyId}/{username}

Headers:

  • Content-Type: application/json — Specifies that the request body is formatted as JSON.

  • Accept: application/json — Indicates that the client expects a response in JSON format.

  • Authorization: Bearer {token} — A valid authentication token is required to access this endpoint.

URL Parameters:

  • companyId (integer): The unique identifier of the company within R1 Discover.

  • username (string): The desired username to check for availability within the specified company.

Request Examples

curl --request GET \
    --get "https://api.r1learning.com/api/v1/users/check-username/company/1/xyz123" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"

Response Examples

{
  "error": 0,
  "message": "Username 'johndoe123' is available for this company"
}

Notes

  • Authorization Required: Ensure the provided Bearer token is valid and has sufficient privileges to create an admin.

  • Data Validation: Usernames must be checked prior to creating new accounts to ensure they are not in use. Ensure to encode the username in the URL if it includes special characters or spaces.

Last updated