This page lists all types of events that you can get through the Get classroom events method.
When the cmd
property of an event is 1
, the event indicates the classroom state changes, and the data
property contains the following fields:
Parameter | Type | Description |
---|---|---|
startTime |
Number | The Unix timestamp (in milliseconds) when the classroom starts, in UTC. This property is available after the state of the classroom changes to "Started". |
state |
Integer | The current state of the classroom:
|
Example
{
"startTime":1611561776588,
"state":1
}
When the cmd
property of an event is 3
, the event indicates the server receives a room chat message, and the data
contains the following fields:
Parameter | Type | Description |
---|---|---|
fromUser |
Object | The user who sends this message. This object contains the following fields:
|
message |
String | The message. |
type |
Integer | The type of the message. Temporarily, you can only set this parameter as 1 (text). |
Example
{
"fromUser":{
"role":"host",
"userName":"jason",
"userUuid":"jason1"
},
"message":"aa",
"type":1
}
When cmd
is 20
, the event indicates that users have entered or left the classroom. data
includes the following fields:
Parameter | Type | Description |
---|---|---|
total |
Integer | The total number of users who have entered and left the classroom. |
onlineUsers |
Object Array | The users who have entered the classroom. This object contains the following fields:
|
offlineUsers |
Object Array | The users who have left the classroom. This object contains the following fields:
|
Example
{
"total":3,
"onlineUsers":[
{
"userName":"",
"userUuid":"",
"role":"0",
"userProperties":{ },
"streamUuid":"",
"type":1,
"updateTime":1611561776588
}
],
"offlineUsers":[
{
"userName":"",
"userUuid":"",
"role":"0",
"userProperties":{},
"streamUuid":"",
"type":1,
"updateTime":1611561776588
}
]
}
When the cmd
property of an event is 1001
, the event indicates the recording state changes, and the data
property contains the following fields:
Parameter | Type | Description |
---|---|---|
recordId |
String | This is the unique identifier of a recording session. A recording session starts when you call a method to start recording and ends when you call this method to stop recording. This field is available only when state is 1 . |
sid |
String | The sid of the Agora Cloud Recording service. This field is available only when state is 1 . |
resourceId |
String | The resourceId of the Agora Cloud Recording service. This field is available only when state is 1 . |
state |
Integer | The current recording state:
|
startTime |
Number | The Unix timestamp (in milliseconds) when the recording starts, in UTC. This property is available after the recording state changes to "Started". |
Example
{
"recordId":"xxx",
"sid":"xxx",
"resourceId":"xxx",
"state":1,
"startTime":1611564500488
}
When the cmd
property of an event is 1101
, the event indicates the number of rewards changes, and the data
property contains the following fields:
Parameter | Type | Description |
---|---|---|
rewardDetails |
Object Array | Each object represents the rewards of a user and contains the following fields:userUuid : String. The user ID.changedReward : Integer, the number of rewards that have changed.total : Integer, the total number of rewards. |
updateTime |
Number | The Unix timestamp (in milliseconds) when the rewards change, in UTC. |
Example:
{
"rewardDetails":[ {
"userUuid":"",
"changedReward": 1,
"totalReward": 10
} ],
"updateTime":1611564500488
}
When the cmd
property of an event is 1003
, the event indicates the resources in the classroom changes, and the data
property contains the following fields:
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
resources |
Object Array | Each object represents a public resource and contains the following fields:resourceUuid : String. The resource ID.resourceName : String, the resource name for display in the classroom.size : Number, the resource size (bytes).url : String, the URL address of the resource.taskUuid : String, the ID of the file conversion task.taskToken : String, the token used by the file conversion task.taskProgress : Object, the progress of the file conversion task. |
operator |
Object | It contains the following fields:userUuid : String. The user ID.userName : String. The user name.role : integer. The role of the user. |
action |
Integer | The resource change type:1 : The resource is added or updated.2 : The resource is deleted. |
Example:
{
"resources": [{
"resourceUuid":"",
"resourceName": "1",
"size": 1024,
"url": "http://xxx.com/ooo",
"taskUuid": "",
"taskToken": "",
"taskProgress": {},
} ],
"operator":{
"role":"1",
"userName":"jason",
"userUuid":"jason1"
},
"action": 1
}