Check Global Username Availability
An overview of the Check Global Username Availability endpoint.
Endpoint Description
This endpoint validates the availability of a username across the R1 Discover platform, ensuring uniqueness for new user or admin account creation. It serves to prevent username conflicts by verifying that no existing user or admin has already registered the requested username.
HTTP Method
GET/api/v1/users/check-userame/global/{username}
Headers
Content-Type:
application/jsonAccept:
application/jsonAuthorization:
Bearer {token}
URL Parameters
username (string): The desired username to check for availability.
Request Examples
curl --request GET \
--get "https://api.r1learning.com/api/v1/users/check-username/global/xyz123" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer {token}"const url = new URL(
"https://api.r1learning.com/api/v1/users/check-username/global/xyz123"
);
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/users/check-username/global/xyz123");
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": "Username 'john_doe' is available"
}{
"error": 1,
"message": "Username 'john_doe' is already taken"
}{
"error": 1,
"message": "Invalid username format"
}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