Real API Example Resources

ResourceEndpointDescription
UserGet UsersGets a list of all users.
UserUpdate userUpdates the user’s information.
UserGet userGet user’s information.
UserActing as UserStart acting as an other user.

User

Get Users

GEThttps://api.example.org/v1/users

Gets a list of all users.

Response Body

FieldTypeDescription
dataArray[]No description
   idIntegerNo description
   usernameStringNo description
   slugStringNo description
   emailStringNo description
   overlay_tokenStringNo description
   avatarStringNo description
   acting_asObjectNo description
      idIntegerNo description
      usernameStringNo description
      slugStringNo description
      emailStringNo description
      overlay_tokenStringNo description
      avatarStringNo description
      scopesString[]No description
      created_atDatetimeNo description
   scopesString[]No description
   created_atDatetimeNo description

Example response

{
    "data": [
        {
            "id": 42,
            "username": "hello world",
            "slug": "hello world",
            "email": "hello world",
            "overlay_token": "hello world",
            "avatar": "hello world",
            "acting_as": {
                "id": 42,
                "username": "hello world",
                "slug": "hello world",
                "email": "hello world",
                "overlay_token": "hello world",
                "avatar": "hello world",
                "scopes": [
                    "hello world"
                ],
                "created_at": "2022-01-01T00:00:00Z"
            },
            "scopes": [
                "hello world"
            ],
            "created_at": "2022-01-01T00:00:00Z"
        }
    ]
}

Update user

PATCHhttps://api.example.org/v1/users/{user}

Updates the user’s information.

Response Body

FieldTypeDescription
idIntegerNo description
usernameStringNo description
slugStringNo description
emailStringNo description
overlay_tokenStringNo description
acting_asObjectNo description
   idIntegerNo description
   usernameStringNo description
   slugStringNo description
   emailStringNo description
   overlay_tokenStringNo description
   avatarStringNo description
   scopesString[]No description
   created_atDatetimeNo description
scopesString[]No description
created_atDatetimeNo description

Example response

{
    "id": 42,
    "username": "hello world",
    "slug": "hello world",
    "email": "hello world",
    "overlay_token": "hello world",
    "acting_as": {
        "id": 42,
        "username": "hello world",
        "slug": "hello world",
        "email": "hello world",
        "overlay_token": "hello world",
        "avatar": "hello world",
        "scopes": [
            "hello world"
        ],
        "created_at": "2022-01-01T00:00:00Z"
    },
    "scopes": [
        "hello world"
    ],
    "created_at": "2022-01-01T00:00:00Z"
}

Get user

GEThttps://api.example.org/v1/users/{user}

Get user’s information.

Response Body

FieldTypeDescription
idIntegerNo description
usernameStringNo description
slugStringNo description
emailStringNo description
overlay_tokenStringNo description
avatarStringNo description
acting_asObjectNo description
   idIntegerNo description
   usernameStringNo description
   slugStringNo description
   emailStringNo description
   overlay_tokenStringNo description
   avatarStringNo description
   scopesString[]No description
   created_atDatetimeNo description
scopesString[]No description
created_atDatetimeNo description

Example response

{
    "id": 42,
    "username": "hello world",
    "slug": "hello world",
    "email": "hello world",
    "overlay_token": "hello world",
    "avatar": "hello world",
    "acting_as": {
        "id": 42,
        "username": "hello world",
        "slug": "hello world",
        "email": "hello world",
        "overlay_token": "hello world",
        "avatar": "hello world",
        "scopes": [
            "hello world"
        ],
        "created_at": "2022-01-01T00:00:00Z"
    },
    "scopes": [
        "hello world"
    ],
    "created_at": "2022-01-01T00:00:00Z"
}

Acting as User

POSThttps://api.example.org/v1/user/acting-as/

Start acting as an other user.

Request Body Parameters

FieldTypeRequiredDescription
user_idIntegerYesUser ID of the other user.

Response Body

FieldTypeDescription
idIntegerNo description
usernameStringNo description
slugStringNo description
emailStringNo description
overlay_tokenStringNo description
avatarStringNo description
scopesString[]No description
created_atDatetimeNo description

Example response

{
    "id": 42,
    "username": "hello world",
    "slug": "hello world",
    "email": "hello world",
    "overlay_token": "hello world",
    "avatar": "hello world",
    "scopes": [
        "hello world"
    ],
    "created_at": "2022-01-01T00:00:00Z"
}