Check a token
curl --request GET \
--url https://public-api.staging.workchats.com/v1/auth/test \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://public-api.staging.workchats.com/v1/auth/test', 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/auth/test"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"bot_user_id": "usr_8a1d2c3e-4b5f-4a6b-8c7d-9e0f1a2b3c4d",
"ok": true,
"scopes": [
"users:read",
"messages:write"
],
"workspace": {
"domain": "corpwise.ae",
"id": "cmp_3f0c1b9e-5d0a-4a57-9a53-2f4f1c9d6b10",
"name": "Corpwise"
}
}{
"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
Check a token
Returns the workspace and bot user the token acts as, and the scopes it holds. Needs no scope. Limited to 100 requests a minute per installation.
GET
/
v1
/
auth
/
test
Check a token
curl --request GET \
--url https://public-api.staging.workchats.com/v1/auth/test \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://public-api.staging.workchats.com/v1/auth/test', 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/auth/test"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"bot_user_id": "usr_8a1d2c3e-4b5f-4a6b-8c7d-9e0f1a2b3c4d",
"ok": true,
"scopes": [
"users:read",
"messages:write"
],
"workspace": {
"domain": "corpwise.ae",
"id": "cmp_3f0c1b9e-5d0a-4a57-9a53-2f4f1c9d6b10",
"name": "Corpwise"
}
}{
"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