Получить профиль по OAuth-токену
POST
/oauth/userinfo
const url = 'https://api.tride.ru/oauth/userinfo';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"access_token":"<токен OAuth>"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tride.ru/oauth/userinfo \ --header 'Content-Type: application/json' \ --data '{ "access_token": "<токен OAuth>" }'Условия доступа описаны в руководстве по OAuth. Порядок подключения.
Request Bodyrequired
Заголовок раздела «Request Bodyrequired»Media typeapplication/json
object
access_token
required
Access token (альтернатива Authorization header)
string
Example
{ "access_token": "<токен OAuth>"}Responses
Заголовок раздела «Responses»При ошибке сервер возвращает поле error.
Media typeapplication/json
Any of:
object
sub
ID пользователя
string | null
firstname
string | null
lastname
string | null
nickname
string | null
avatar
string | null
email
string | null
phone
string | null
result
boolean
gender
age
object
error
required
Код или текст ошибки.
string
field
Параметр запроса, если сервер указал его.
string
retry_after
Задержка до следующей попытки в секундах.
integer
Example generated
{ "sub": "example", "firstname": "example", "lastname": "example", "nickname": "example", "avatar": "example", "email": "example", "phone": "example", "result": true, "gender": "example", "age": "example"}