Skip to content

Checks if the user is logged in and lists the basic user information. Returns 200 and the user data, 404 if the user does not exist, or 401 if not logged in.

GET
/api/user/{id}

Authorizations

api_key
Type: API Key (header: X-CSRF-Token)

Parameters

Path Parameters

id*
Typestring
Required

Responses

Success
JSON
{
"id": 0,
"name": "string",
"avatar": "string",
"isSleeping": true
}
Authorization
api_key
Variables
Key
Value
id*
cURL
curl -X GET \
'http://localhost/api/user/{id}'

Samples

cURL
curl -X GET http://localhost/api/user/{id}
JavaScript
fetch("http://localhost/api/user/{id}")
  .then(response => response.json())
  .then(data => console.log(data));
PHP
file_get_contents("http://localhost/api/user/{id}");
Python
import requests
response = requests.get("http://localhost/api/user/{id}")
print(response.json())