Skip to content

Users API

This document describes the APIs of Aspecta for users.

Get User

Get self information of a user

  • Endpoint

    GET https://api.aspecta.ai/v1/users/me

  • Request

    No additional parameters required. We will use the access token to identify the user. The following snippet shows a sample request:

    http
    POST /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

    bash
    curl -H "Authorization: Bearer 7/Lvq3XoJkU1oNz8A82v3b6T2I" https://api.aspecta.ai/v1/users/me
  • Response

    FieldDescription
    user_idint The id of the user which is unique and immutable in Aspecta
    usernamestring The name of the user which is unique in Aspecta
    profile_urlstring The url of the user
    nicknamestring The nick name of the user
    avatarstring The url of the user's avatar
    introductionstring The introduction of the user

    The 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