Skip to main content

Query user status

GET
https://api.agora.io/dev/v1/channel/user/property/{appid}/{uid}/{channelName}

Use this endpoint to get the status of a specified user. It checks whether the user is in the specified channel and, if present, returns the user's role and the time they joined.

Request

The request URL and request body is case-sensitive. All requests must use HTTPS.

Request header

  • Content-Type: application/json
  • The request header must contain the Authorization field. For details, see RESTful authentication.

Path parameters

appid stringrequired

The App ID of the project. You can get it through one of the following methods:

uid numberrequired

The user ID. This parameter does not support string user accounts; use the integer user ID only.

channelName stringrequired

The channel name.

Response

A 200 status code indicates success. The response body contains the following parameters:

OK
  • success boolean

    The state of this request:

    • true: Success.
    • false: Reserved for future use.
  • data object

    User statistics.

    Show propertiesHide properties
    • in_channel boolean

      Whether the user is in the channel. When false, no other fields are returned.

    • uid number

      The user ID.

    • join number

      The Unix timestamp (in seconds) of when the user joined the channel.

    • role number

      The role of the user in the channel:

      • 0: Unknown user role.
      • 1: User, in a communication channel.
      • 2: Host, in a live broadcast channel.
      • 3: Audience, in a live broadcast channel.
    • platform number

      The platform of the user's device. Common values include:

      • 1: Android
      • 2: iOS
      • 5: Windows
      • 6: Linux
      • 7: Web
      • 8: macOS
      • 0: Others

If the status code is not 200, the request fails. See the message field in the response body for the reason for this failure. Refer to Response status codes for details.

Authorization

This endpoint requires Basic authentication.

Request example

Test this request in Postman or use one of the following code examples:


_4
curl --request GET \
_4
--url https://api.sd-rtn.com/dev/v1/channel/user/property/<appid>/<uid>/<channelName> \
_4
--header 'Accept: application/json' \
_4
--header 'Authorization: Basic <your_base64_encoded_credentials>'

Response example


_10
{
_10
"success": true,
_10
"data": {
_10
"join": 1640330382,
_10
"uid": 2845863044,
_10
"in_channel": true,
_10
"platform": 7,
_10
"role": 2
_10
}
_10
}