Appearance
Users API
This document describes the APIs of Aspecta for users.
Get User
Get self information of a user
Endpoint
Request
No additional parameters required. We will use the access token to identify the user. The following snippet shows a sample request:
httpPOST /token HTTP/1.1 Host: https://api.aspecta.ai/v1/users/me Content-Type: application/x-www-form-urlencoded Authorization: Bearer 7/Lvq3XoJkU1oNz8A82v3b6T2I
CURL Example
bashcurl -H "Authorization: Bearer 7/Lvq3XoJkU1oNz8A82v3b6T2I" https://api.aspecta.ai/v1/users/me
Response
Field Description user_id
int
The id of the user which is unique and immutable in Aspectausername
string
The name of the user which is unique in Aspectaprofile_url
string
The url of the usernickname
string
The nick name of the useravatar
string
The url of the user's avatarintroduction
string
The introduction of the userThe following snippet shows a sample response:
json{ "user_id": 18, "username": "jack", "profile_url": "https://aspecta.ai/u/jack", "nickname": "Jack Aspecta", "avatar": "https://storage.googleapis.com/storage-aspecta-id/resources/avatar/production/avatar-18.png", "introduction": "hello world" }
Errors
Error Code invalid_user
invalid_token