Check Company Username

An overview of the Check Company Username endpoint.

Endpoint Description

This endpoint validates the availability of a username within a specific company with the R1 Discover platform, ensuring uniqueness for new user account creation. It serves to prevent username conflicts by verifying that no existing user within this company has already registered the requested username.

Company usernames are used when a company wants to set specific usernames for their users. It is possible to request a unique login page to R1 Discover that will validate the company specific usernames.

HTTP Method

GET/api/v2/usernames/check/company/{companyId}/{companyUsername}

Request

Headers

  • Content-Type: application/json

  • Accept: application/json

  • Authorization: Bearer {token}

URL Parameters

  • companyId (integer): The id of the company to validate usernames within.

  • comapnyUsername (string): The desired username to check for availability.

Request Examples

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

Response

Data Dictionary

  • company_id (integer): THe id of the company the username is validated against.

  • username (string): The validated company username in the R1 Discover system.

  • is_available (boolean): Returns true/false to indicate username availability

  • message (string): Simple message indicating availability.

Response Examples


[
    {
        "company_id": "1",
        "company_username": "FB1234",
        "is_available": true,
        "message": "base.user_is_available_for_this_company"
    },
    {
        "company_id": "1",
        "company_username": "FB12345",
        "is_available": false,
        "message": "Username \"FB12345\" is already taken for this company"
    }
]

 
Link to the endpoint within Postman

Notes

  • Authorization Required: Ensure the provided Bearer token is valid and has sufficient privileges to access the endpoint.

  • 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