Skip to main content

Get channel events

Get channel events

GET
https://api.agora.io/dev/v2/project/<appid>/rtm/vendor/channel_events

This method gets the channel events from the address specified by the Agora Signaling server. Events you acquire using this API are removed from the server. You cannot retrieve the same event twice.

The Signaling server stores a maximum of 2,000 events, with the latest event replacing the oldest when this limit is exceeded. The backend returns a maximum of 1,000 events per request, and the number of requests for each app ID must not exceed 10 per second.

caution

Agora does not guarantee event time sequence across geographical regions. Events pulled from different regions may contain duplicates since synchronization only occurs within regions, not across them.

Request

Path parameters

appid stringrequired

The App ID of your Agora project.

This endpoint does not require any query parameters or a request body.

Response

  • If the returned status code is 200, the request was successful. The response body contains the result of the request.
OK
  • result string

    The result of this request.

    • success: The request succeeds.
    • failed: The request fails.
  • request_id string

    The unique ID of this request.

  • events array

    An array of join and leave events. Each event object contains:

      • group_id string

        The corresponding channel ID.

      • user_id string

        The corresponding user ID.

      • type string

        The event type:

        • Join: A user has joined the channel.
        • Leave: A user has left the channel.
      • ms integer

        Number of milliseconds since January 1, 1970 (UTC) to the UTC time when the server receives the message.

  • If the returned status code is not 200, the request failed. The response body includes the error code and description. Refer to status codes to understand the possible reasons for failure.

Authorization

This endpoint requires Basic Auth.

Request example


_2
curl -X GET 'https://api.agora.io/dev/v2/project/876922cbca0098dff4323566daa89675/rtm/vendor/channel_events' \
_2
-H 'Authorization: Basic <your_base64_encoded_credentials>'

Response example


_12
{
_12
"result": "success",
_12
"request_id": "10116762670167749259",
_12
"events": [
_12
{
_12
"group_id": "example_channel_id",
_12
"user_id": "rtmtest_RTM_4852_4857w7%",
_12
"type": "Join",
_12
"ms": 1578027418981
_12
}
_12
]
_12
}