import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
const user = await client.users.retrieve('user_id');
console.log(user.id);
{
"id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"access_profiles": [
{
"id": "<string>",
"user_id": "<string>",
"role": "manager",
"account": {
"id": "<string>",
"name": "<string>"
}
}
],
"organization_id": "<string>",
"is_organization_admin": true,
"preferences": {}
}
Get basic information for a user. The requester must belong to the same organization as the target user and be an admin or manager of an account the target user belongs to.
import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
const user = await client.users.retrieve('user_id');
console.log(user.id);
{
"id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"access_profiles": [
{
"id": "<string>",
"user_id": "<string>",
"role": "manager",
"account": {
"id": "<string>",
"name": "<string>"
}
}
],
"organization_id": "<string>",
"is_organization_admin": true,
"preferences": {}
}
Successful Response
The response is of type object
.