User Info Endpoint
Fetch the authenticated user's profile using the access token.
Request
HTTP
GET https://api.sloxly.com/v1/Oauth/userinfo Authorization: Bearer ACCESS_TOKEN
Response
JSON — Success (200)
{
"status": "success",
"user": {
"id": 42,
"username": "johndoe",
"email": "john@example.com",
"first_name": "John",
"last_name": "Doe",
"avatar": "https://assets.sloxly.com/avatars/42.jpg"
}
}PHP Example
PHP
$ch = curl_init("https://api.sloxly.com/v1/Oauth/userinfo"); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ["Authorization: Bearer $accessToken"], ]); $user = json_decode(curl_exec($ch), true); echo "Welcome, " . $user['user']['first_name'];
Response Fields
| Field | Type | Description |
|---|---|---|
id | integer | Unique user ID |
username | string | Username |
email | string | Email address |
first_name | string | First name |
last_name | string | Last name |
avatar | string|null | Avatar URL |