Check logged in user
GET
{{server}}/api/v1/counter/checkThis endpoint checks whether the token is valid and returns the logged in user information.
Request
Authorization
| Header | Value |
|---|---|
Authorization | Bearer {{counterToken}} |
Headers
| Key | Value |
|---|---|
Accept | application/json |
Code snippets
- cURL
- JavaScript
- Python
curl -X GET '{{server}}/api/v1/counter/check' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {{counterToken}}'
const response = await fetch("{{server}}/api/v1/counter/check", {
method: "GET",
headers: {
"Accept": "application/json",
"Authorization": "Bearer {{counterToken}}"
},
});
const data = await response.json();
console.log(data);
import requests
url = "{{server}}/api/v1/counter/check"
headers = {
"Accept": "application/json",
"Authorization": "Bearer {{counterToken}}"
}
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
Example
Example request
GET
{{server}}/api/v1/counter/checkHeaders (1)
| Key | Value |
|---|---|
Accept | application/json |
Example response 200 Ok
Response headers (9)
| Key | Value |
|---|---|
Access-Control-Expose-Headers | * |
Cache-Control | no-store, no-cache, must-revalidate |
Access-Control-Allow-Origin | * |
Access-Control-Allow-Methods | POST, PUT, GET, OPTIONS, DELETE |
Access-Control-Allow-Credentials | true |
Content-Length | 773 |
Access-Control-Max-Age | 86400 |
Access-Control-Allow-Headers | Content-Type, Authorization, X-Requested-With |
Content-Type | application/json;charset=utf-8 |
Body
{
"type": 2,
"subType": 1,
"key": "00000000-0000-4000-0002-000000000006",
"username": "user1",
"name": "User 1",
"defaultLang": "00000000-0000-4000-0004-000000000001",
"branchRoles": [
{
"branch": "00000000-0000-4000-0003-000000000001",
"roles": []
},
{
"branchGroup": "1884df65-1742-437f-dd4a-d48c73832871",
"roles": [
"00000000-0000-4000-0006-000000000005"
]
}
],
"languages": [
"00000000-0000-4000-0004-000000000001",
"00000000-0000-4000-0004-000000000017"
],
"status": 1,
"aspect": null,
"ldap": false,
"time": 1718374324609,
"sso": false,
"permissions": [
{
"branch": "18833a15-16f5-4dfd-e3d3-d09647775ff8",
"permissions": [
"media.**",
"apps.counter",
"apps.counter.**",
"entities.**.read"
]
},
{
"branch": "00000000-0000-4000-0003-000000000001",
"permissions": [
"media.**",
"apps.counter",
"apps.counter.**",
"entities.**.read"
]
}
]
}