import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
const userInfo = await client.users.info();
console.log(userInfo.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": {},
"assumed_access_profile": {
"id": "<string>",
"user_id": "<string>",
"role": "manager",
"account": {
"id": "<string>",
"name": "<string>"
}
}
}
Get basic information for the logged in user making this request including preferences.
import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
const userInfo = await client.users.info();
console.log(userInfo.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": {},
"assumed_access_profile": {
"id": "<string>",
"user_id": "<string>",
"role": "manager",
"account": {
"id": "<string>",
"name": "<string>"
}
}
}
Successful Response
The response is of type object
.