Get a user
curl --request GET \
--url https://public-api.staging.workchats.com/v1/users/{id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://public-api.staging.workchats.com/v1/users/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://public-api.staging.workchats.com/v1/users/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"ok": true,
"user": {
"avatar_url": "https://cdn.workchats.com/a/9a1d2c3e.png",
"display_name": "Connor",
"email": "[email protected]",
"id": "usr_9a1d2c3e-4b5f-4a6b-8c7d-9e0f1a2b3c4d",
"is_active": true,
"is_admin": false,
"is_bot": false,
"is_external": false,
"name": "Connor Berwick",
"timezone": "Asia/Dubai",
"title": "Sales"
}
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}Reference
Get a user
One person, by id. A bot, a person in another workspace, or a guest members cannot see is user_not_found. Needs users:read. Limited to 100 requests a minute per installation.
GET
/
v1
/
users
/
{id}
Get a user
curl --request GET \
--url https://public-api.staging.workchats.com/v1/users/{id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://public-api.staging.workchats.com/v1/users/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://public-api.staging.workchats.com/v1/users/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"ok": true,
"user": {
"avatar_url": "https://cdn.workchats.com/a/9a1d2c3e.png",
"display_name": "Connor",
"email": "[email protected]",
"id": "usr_9a1d2c3e-4b5f-4a6b-8c7d-9e0f1a2b3c4d",
"is_active": true,
"is_admin": false,
"is_bot": false,
"is_external": false,
"name": "Connor Berwick",
"timezone": "Asia/Dubai",
"title": "Sales"
}
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}{
"error": {
"code": "token_revoked",
"message": "The token has been revoked."
},
"ok": false,
"request_id": "F7p0mJcXk3tq2x0AAAAB"
}Authorizations
Bot token (wc_bot_live_… or wc_bot_test_…) from the OAuth install
Path Parameters
User id, usr_ prefixed
Response
The user
One user.
Available options:
true A person in the workspace. email is present only with the users:read.email scope, and only when the person lets colleagues see it; a removed person never has one. Phone numbers are never included.
Show child attributes
Show child attributes
Example:
{
"avatar_url": "https://cdn.workchats.com/a/9a1d2c3e.png",
"display_name": "Connor",
"email": "[email protected]",
"id": "usr_9a1d2c3e-4b5f-4a6b-8c7d-9e0f1a2b3c4d",
"is_active": true,
"is_admin": false,
"is_bot": false,
"is_external": false,
"name": "Connor Berwick",
"timezone": "Asia/Dubai",
"title": "Sales"
}