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 thedata
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 messages). |
Example
{
"fromUser":{
"role":"host",
"userName":"jason",
"userUuid":"jason1"
},
"message":"aa",
"type":1
}
When the cmd
property of an event 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 changed rewards.total : Integer. The total number of rewards after the change. |
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 change, 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.size : Number. The resourc size (bytes).url : String. The URL address of the resource.taskUuid : String. The ID of the file conversion task.taskToken : String. The token used for the file conversion task.taskProgress : Object. The progress of a file conversion task. |
operator |
Object | It contains the following fields:userUuid : String. The user ID.userName : String. The user name.role : Integer. Th user role. |
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
}
When the cmd
property of an event is 1501
, the event indicates the users "on the stage" change, and thedata
property contains the following fields:
Parameter | Type | Description |
---|---|---|
acceptedUsers |
Object Array | The list of users who are now "on the stage". The object contains the following fields:userUuid : String. The user ID. |
addAcceptedUsers |
Object Array | The list of users who have just "gone onto the stage". The object contains the following fields:userUuid : String. The user ID. |
removeAcceptedUsers |
Object Array | The list of users who have just "left the stage". The object contains the following fields:userUuid : String. The user ID. |
Example
{
"acceptedUsers": [{
"userUuid":""
}],
"addAcceptedUsers": [{
"userUuid":""
}],
"removeAcceptedUsers": [{
"userUuid":""
}]
}
When the cmd
property of an event is 1502
, the event indicates the users who wave their hands change, and the data
property contains the following fields:
Parameter | Type | Description |
---|---|---|
progressUsers |
Object Array | The list of users who are waving their hands. The object contains the following fields:userUuid : String. The user ID.payload : Object. |
addProgressUsers |
Object Array | The list of users who have just started waving their hands. The object contains the following fields:userUuid : String. The user ID.payload : Object. |
removeProgressUsers |
Object Array | The list of users who have just stopped waving their hands. The object contains the following fields:userUuid : String. The user ID.payload : Object. |
Example
{
"progressUsers": [{
"userUuid":"",
"payload":{}
}],
"addProgressUsers": [{
"userUuid":"",
"payload": {}
}],
"removeProgressUsers": [{
"userUuid":"",
"payload": {}
}]
}