User Profile
API

API

The user profiles API is used to get information about users.

Get user profiles data

userProfiles()

To get a list of all user profiles, use the userProfiles() method API.

import { roqBrowserClient } from "lib/roq/roq-client"
 
const userProfiles = async() => {
    const response = await roqBrowserClient.roqPlatform.userProfiles({
        limit: 5
    })
    return response
}

The response will be an array of user profiles.

{
    "data": [
        {
            "id": "3bd1a0c8-c8cd-4dc6-b961-fcfd356f5db4",
            "reference": "3bd1a0c8-c8cd-4dc6-b961-fcfd356f5db4",
            "firstName": "",
            "lastName": "",
            "email": "aitesta212@roq.tech",
            "phone": null,
            "locale": "en-US",
            "timezone": "Asia/Jakarta",
            "avatarUrl": ""
        }
    ],
    "totalCount": 1
}
ParameterTypeDescription
limitintegerLimit the results
searchobjectSearch parameter
filterobjectFilter parameter
offsetintegerOffset the results
orderobjectOrder parameter

userProfile()

To get a specific user profile, use the userProfile() method API.

import { roqBrowserClient } from "lib/roq/roq-client"
 
const roqClient = useRoqClient()
 
const userProfile = async() => {
    const userId = "3bd1a0c8-c8cd-4dc6-b961-fcfd356f5db4"
    const response = await roqBrowserClient.roqPlatform.userProfile({
		id: userId
    })
    return response
}
ParameterTypeDescription
iduuidThe user profile ID