Skip to main content

Notification event types

After enabling Agora message notifications, the Agora notification server sends channel event notifications to your server through HTTPS POST requests. The data format is JSON, the character encoding is UTF-8, and the signature algorithm can be either HMAC/SHA1 or HMAC/SHA256.

This page explains the types of events returned in channel event callbacks and their meanings.

Request header

The message notification callback header contains the following fields:

FieldValue
Content-TypeApplication/json
Agora-SignatureThe signature value generated by Agora using the customer key and HMAC/SHA1 algorithm. Use the customer key and HMAC/SHA1 algorithm to verify the signature value. See Verify the signature for details.
Agora-Signature-V2The signature value generated by Agora using the customer key and HMAC/SHA256 algorithm. Use the customer key and HMAC/SHA256 algorithm to verify the signature value. See Verify the signature for details.

Request body

The message notification callback request body contains the following fields:

FieldTypeDescription
noticeIdStringNotification ID. Identifies an event notification from the Agora server.
productIdNumberBusiness ID. A value of 17 indicates a Conversational AI Engine notification.
eventTypeNumberThe event type of the notification. See Event types for details.
notifyMsNumberThe Unix timestamp (ms) when the Agora message server sends the event notification to your server. This value is updated when the notification is retried.
sidStringThe session ID.
payloadJSON ObjectThe specific content of the notification event. payload varies depending on the event type. For details, see Event types.

Following is a sample message notification callback request body:


_8
{
_8
"sid": "C866467GVJJ54687",
_8
"noticeId": "2000001428:4330:107",
_8
"productId": 17,
_8
"eventType": 101,
_8
"notifyMs": 1611566412672,
_8
"payload": {...}
_8
}

Event types

The Agora message notification service notifies the following Conversational AI Engine events:

eventTypeEvent nameEvent description
101agent joinedThe agent joins the channel.
102agent leftThe agent leaves the channel.
110agent errorAgent error.

101 agent joined

An eventType of 101 indicates that an agent has joined a channel. The payload contains the following fields:

FieldData TypeDescription
agent_idStringAgent ID.
start_tsNumberTimestamp of when the agent was created.
channelStringThe name of the channel the agent is in.

102 agent left

An eventType of 102 indicates that an agent has left a channel. The payload contains the following fields:

FieldData TypeDescription
agent_idStringAgent ID.
start_tsNumberTimestamp of when the agent was created.
stop_tsNumberTimestamp when the agent left the channel.
channelStringThe name of the channel the agent was in.
statusStringAgent status.
messageStringThe reason why the agent left the channel.

110 agent error

An eventType of 110 indicates that an agent has encountered an error. The payload contains the following fields:

FieldData TypeDescription
agent_idStringAgent ID.
start_tsNumberTimestamp of when the agent was created.
channelStringThe name of the channel that the agent is in.
turn_idStringSubtitle conversation turn. For details, see Live Subtitle API Reference.
errorsArrayThe error message. Contains the following fields:
  • module: The module where the error occurred.
  • turn_id: Subtitle dialogue turn.
  • code: Error code. Refer to the error code document of the vendor corresponding to the error module for detailed information.
  • message: The error message.
vundefined