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:
Field | Value |
---|---|
Content-Type | Application/json |
Agora-Signature | The 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-V2 | The 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:
Field | Type | Description |
---|---|---|
noticeId | String | Notification ID. Identifies an event notification from the Agora server. |
productId | Number | Business ID. A value of 17 indicates a Conversational AI Engine notification. |
eventType | Number | The event type of the notification. See Event types for details. |
notifyMs | Number | The Unix timestamp (ms) when the Agora message server sends the event notification to your server. This value is updated when the notification is retried. |
sid | String | The session ID. |
payload | JSON Object | The 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:
Event types
The Agora message notification service notifies the following Conversational AI Engine events:
eventType | Event name | Event description |
---|---|---|
101 | agent joined | The agent joins the channel. |
102 | agent left | The agent leaves the channel. |
110 | agent error | Agent error. |
101 agent joined
An eventType
of 101
indicates that an agent has joined a channel. The payload
contains the following fields:
Field | Data Type | Description |
---|---|---|
agent_id | String | Agent ID. |
start_ts | Number | Timestamp of when the agent was created. |
channel | String | The 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:
Field | Data Type | Description |
---|---|---|
agent_id | String | Agent ID. |
start_ts | Number | Timestamp of when the agent was created. |
stop_ts | Number | Timestamp when the agent left the channel. |
channel | String | The name of the channel the agent was in. |
status | String | Agent status. |
message | String | The 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:
Field | Data Type | Description |
---|---|---|
agent_id | String | Agent ID. |
start_ts | Number | Timestamp of when the agent was created. |
channel | String | The name of the channel that the agent is in. |
turn_id | String | Subtitle conversation turn. For details, see Live Subtitle API Reference. |
errors | Array | The error message. Contains the following fields:
|