This page provides detailed help for the Flexible Classroom RESTful APIs.
All requests are sent to the host: api.agora.io.
The Content-Type of all requests is application/json.
Flexible Classroom Cloud Service uses tokens for authentication. You need to put the following information to the x-agora-token
and x-agora-uid
fields when sending your HTTP request:
For details, see Generate an RTM Token.
Call this method to create a classroom. After it is created, the classroom is reserved for five days.
URL parameters
Pass the following parameters in the URL.
Parameter | Type | Description |
---|---|---|
region |
String | (Required) The region for connection. Flexible Classroom supports the following regions:cn : Mainland China.ap : Asia Pacific.eu : Europe.na : North America. |
appId |
String | (Required) Agora App ID. |
roomUuid |
String | (Required) The classroom ID. This is the globally unique identifier of a classroom. It is also used as the channel name when a user joins an RTC or RTM channel. The string length must be less than 64 bytes. The following characters are supported:
|
Request body parameters
Pass in the following parameters in the request body:
Parameter | Type | Description |
---|---|---|
roomType |
String | (Required) The type of the classroom. You can set the value to :
|
roomName |
String | (Required) The name of the classroom. |
roomProperties |
Object | (Optional) The properties of the classroom. |
roomProperties.schedule |
Object | (Optional) The schedule of the classroom. |
roomProperties.schedule.startTime |
Integer | (Optional) The start time of the class. Once set, this parameter value cannot be changed. |
roomProperties.schedule.duration |
Integer | (Optional) The duration of the class. |
roomProperties.schedule.closeDelay |
Integer | (Optional) The delay of the class end time. |
roomProperties.processes |
Object | (Optional) The process of inviting students to go "on the stage". |
roomProperties.processes.handsUp |
Object | (Optional) The settings of "on the stage". |
roomProperties.processes.handsUp.maxAccept |
Integer | (Optional) The maximum number of students "on the stage". |
roomProperties.hostingScene |
Object | (Optional) The unique classroom properties of a vocational lecture hall. |
roomProperties.hostingScene.videoURL |
String | (Optional) The teacher's CDN stream URL (main video URL). |
roomProperties.hostingScene.reserveVideoURL |
String | (Optional) The teacher's CDN stream URL (backup video URL). |
roomProperties.hostingScene.finishType |
Integer | (Optional) The way the class ends.0 : The class automatically ends when the recording finishes playing.1 : The class ends when the teacher clicks the End Class button; this also stops the recording playback. |
{
"roomName": "jasoncai61734",
"roomType": 4,
"roomProperties": {
"schedule": {
"startTime": 1655452800000,
"duration": 600,
"closeDelay": 300
},
"processes": {
"handsUp": {
"maxAccept": 10
}
}
}
}
Parameter | Type | Description |
---|---|---|
code |
Integer | Request status code:
|
msg |
String | Detailed information about the code. |
ts |
Number | The current Unix timestamp (in milliseconds) of the server in UTC. |
{
"msg": "Success",
"code": 0,
"ts": 1610167740309
}
Call this method to kick a specified user out of a classroom. After a successful method call, the server triggers an event indicating a user leaves the classroom. You can use the dirty
parameter to determine whether the user can enter the classroom afterwards.
URL parameters
Pass the following parameters in the URL.
Parameter | Type | Description |
---|---|---|
region |
String | (Required) The region for connection. For details, see Network geofencing. Flexible Classroom supports the following regions:cn : Mainland China.ap : Asia Pacific.eu : Europe.na : North America. |
appId |
String | (Required) Agora App ID. |
roomUuid |
String | (Required) The classroom ID. This is the globally unique identifier of a classroom. It is also used as the channel name when a user joins an RTC or RTM channel. The string length must be less than 64 bytes. Supported character scopes are: |
userUuid |
String | (Required) The user ID. This is the unique identifier of the user and also the user ID used when logging in to the Agora RTM system. The string length must be less than 64 bytes. Supported character scopes are: |
Request body parameters
Pass in the following parameters in the request body.
Parameter | Type | Description |
---|---|---|
dirty |
Object | (Optional) The user privilege:
|
Request URL
https://api.agora.io/edu/apps/{your_app_Id}/v2/rooms/test_class/users/123/exit
Request Body
{
"dirty": {
"state": 1,
"duration": 600
}
}
Parameter | Type | Description |
---|---|---|
code |
Integer | Business status code: |
msg |
String | The detailed information. |
ts |
Number | The current Unix timestamp (in milliseconds) of the server in UTC. |
{
"msg": "Success",
"code": 0,
"ts": 1610167740309
}
Call this method to set the classroom state: Not started, Started, Ended. For details, see What classroom states does Flexible Classroom support?
URL parameters
Pass the following parameter in the URL.
Parameter | Type | Description |
---|---|---|
region |
String | (Required) The region for connection. For details, see Network geofencing. Flexible Classroom supports the following regions:cn : Mainland China.ap : Asia Pacific.eu : Europe.na : North America. |
appId |
String | (Required) Agora App ID. |
roomUuid |
String | (Required) The classroom ID. This is the globally unique identifier of a classroom. It is also used as the channel name when a user joins an RTC or RTM channel. The string length must be less than 64 bytes. Supported character scopes are: |
state |
Integer | (Required) The classroom state:0 : Not started.1 : Started.2 : Ended.3 : The room is closed and users can no longer join the room. |
https://api.agora.io/edu/apps/{yourappId}/v2/rooms/test_class/states/1
Parameter | Type | Description |
---|---|---|
code |
Integer | Business status code: |
msg |
String | The detailed information. |
ts |
Number | The current Unix timestamp (in milliseconds) of the server in UTC. |
"status": 200,
"body":
{
"code": 0,
"msg": "Success",
"ts": 1610450153520
}
Call this method to start or stop recording a specified classroom.
URL parameters
Pass the following parameter in the URL.
Parameter | Type | Description |
---|---|---|
region |
String | (Required) The region for connection. For details, see Network geofencing. Flexible Classroom supports the following regions:cn : Mainland China.ap : Asia Pacific.eu : Europe.na : North America. |
appId |
String | (Required) Agora App ID. |
roomUuid |
String | (Required) The classroom ID. This is the globally unique identifier of a classroom. It is also used as the channel name when a user joins an RTC or RTM channel. The string length must be less than 64 bytes. Supported character scopes are: |
state |
Integer | (Required) The recording state:0 : Stop recoding.1 : Started. |
Request body parameters
Pass in the following parameters in the request body.
Parameter | Type | Description |
---|---|---|
mode |
String | (Optional) The recording mode:web to enable web page recording mode. The format of recorded files is MP4. When the length of the recorded file reaches around two hours, or when the size of the file exceeds around 2 GB, the recording service automatically creates another MP4 file. |
webRecordConfig |
Object | (Optional) When the mode is set as web , you need to set the detailed configuration of the web page recording through webRecordConfig , including the following fields:
|
retryTimeout |
Number | The amount of time (seconds) that the Flexible Classroom cloud service waits between tries. The Flexible Classroom cloud service reties twice at most. |
Request URL
https://api.agora.io/edu/apps/{yourappId}/v2/rooms/test_class/records/states/1
Request Body
{
"mode": "web",
"webRecordConfig": {
"url":"https://webdemo.agora.io/xxxxx/?userUuid={recorder_id}&roomUuid={room_id_to_be_recorded}&roleType=0&roomType=4&pretest=false&rtmToken={recorder_token}&language=en&appId={your_app_id}",
"rootUrl":"https://xxx.yyy.zzz"
},
"retryTimeout": 60
}
Parameter | Type | Description |
---|---|---|
code |
Integer | Business status code: |
msg |
String | The detailed information. |
ts |
Number | The current Unix timestamp (in milliseconds) of the server in UTC. |
"status": 200,
"body":
{
"code": 0,
"ts": 1610450153520
}
Call this method during the recording to update the recording configurations. Every time this method is called, the previous configurations are overwritten.
URL parameters
Pass the following parameter in the URL.
Parameter | Type | Description |
---|---|---|
region |
String | (Required) The region for connection. For details, see Network geofencing. Flexible Classroom supports the following regions:cn : Mainland China.ap : Asia Pacific.eu : Europe.na : North America. |
appId |
String | (Required) Agora App ID. |
roomUuid |
String | (Required) The classroom ID. This is the globally unique identifier of a classroom. It is also used as the channel name when a user joins an RTC or RTM channel. The string length must be less than 64 bytes. Supported character scopes are: |
Request body parameters
Pass in the following parameters in the request body.
Parameter | Type | Description |
---|---|---|
webRecordConfig |
Object | (Optional) Recording configurations:
|
Request URL
https://api.agora.io/edu/apps/{yourappId}/v2/rooms/test_class/records/states/1
Request Body
{
"webRecordConfig": {
"onhold": false
}
}
Parameter | Type | Description |
---|---|---|
code |
Integer | Business status code: |
msg |
String | The detailed information. |
ts |
Number | The current Unix timestamp (in milliseconds) of the server in UTC. |
"status": 200,
"body":
{
"code": 0,
"ts": 1610450153520
}
Get the recording list in a specified classroom.
You can fetch data in batches with the nextId
parameter. You can get up to 100 pieces of data for each batch.
URL parameters
Pass the following parameter in the URL.
Parameter | Type | Description |
---|---|---|
region |
String | (Required) The region for connection. For details, see Network geofencing. Flexible Classroom supports the following regions:cn : Mainland China.ap : Asia Pacific.eu : Europe.na : North America. |
appId |
String | (Required) Agora App ID. |
roomUuid |
String | (Required) The classroom ID. This is the globally unique identifier of a classroom. It is also used as the channel name when a user joins an RTC or RTM channel. The string length must be less than 64 bytes. Supported character scopes are: |
Query parameters
Parameter | Type | Description |
---|---|---|
nextId |
String | (Optional) The starting ID of the next batch of data. When you call this method to get the data for the first time, leave this parameter empty or set it as null. Afterward, you can set this parameter as the nextId that you get in the response of the previous method call. |
Example one:
https://api.agora.io/edu/apps/{yourappId}/v2/rooms/test_class/records?null
Example two:
https://api.agora.io/edu/apps/{yourappId}/v2/rooms/test_class/records?nextId=xxx
Parameter | Type | Description |
---|---|---|
code |
Integer | Business status code: |
msg |
String | The detailed information. |
ts |
Number | The current Unix timestamp (in milliseconds) of the server in UTC. |
data |
Object | Include the following parameters:
|
"status": 200,
"body":
{
"code": 0,
"msg": "Success",
"ts": 1610450153520,
"data": {
"total": 17,
"list": [
{
"recordId": "xxxxxx",
"appId": "xxxxxx",
"roomUuid": "jason0",
"startTime": 1602648426497,
"endTime": 1602648430262,
"resourceId": "xxxxxx",
"sid": "xxxxxx",
"recordUid": "xxxxxx",
"boardId": "xxxxxx",
"boardToken": "xxxxxx",
"type": 2,
"status": 2,
"url": "scenario/recording/xxxxxx/xxxxxx/xxxxxx.m3u8",
"recordDetails":[
{
"url":"xxxx/xxxx.mp4"
}
]
},
{...},
],
"count": 17
}
}
Query a specified type of event in a specified classroom.
You can fetch data in batches with the nextId
parameter. You can get up to 100 pieces of data for each batch.
URL parameters
Pass the following parameters in the URL.
Parameter | Type | Description |
---|---|---|
region |
String | (Required) The region for connection. For details, see Network geofencing. Flexible Classroom supports the following regions:cn : Mainland China.ap : Asia Pacific.eu : Europe.na : North America. |
appId |
String | (Required) Agora App ID. |
roomUuid |
String | (Required) The classroom ID. This is the globally unique identifier of a classroom. It is also used as the channel name when a user joins an RTC or RTM channel. The string length must be less than 64 bytes. Supported character scopes are: |
Query parameters
Parameter | Type | Description |
---|---|---|
nextId |
String | (Optional) The starting ID of the next batch of data. When you call this method to get the data for the first time, leave this parameter empty or set it as null. Afterward, you can set this parameter as the nextId that you get in the response of the previous method call. |
cmd |
Integer | (Optional) Event type. For details, see Flexible Classroom Cloud Service Events. |
Request URL
Example one:
https://api.agora.io/edu/apps/{appId}/v2/rooms/test_class/sequences?null&cmd=1
Example two:
https://api.agora.io/edu/apps/{appId}/v2/rooms/test_class/sequences?nextId=50&cmd=1
Parameter | Type | Description |
---|---|---|
code |
Integer | Business status code: |
msg |
String | The detailed information. |
ts |
Number | The current Unix timestamp (in milliseconds) of the server in UTC. |
data |
Object | Include the following parameters:
|
{
"msg":"Success",
"code":0,
"ts":1610433913533,
"data":{
"total":1,
"list":[
{
"roomUuid": "",
"cmd": 20,
"sequence": 1,
"version": 1,
"data":{}
}
],
"nextId": null,
"count":1
}
}
Get all events in the classrooms associated with a specified App ID.
You can call this method at regular intervals to listen for all the events that occur in the flexible classrooms.
URL parameters
Pass the following parameter in the URL.
Parameter | Type | Description |
---|---|---|
region |
String | (Required) The region for connection. For details, see Network geofencing. Flexible Classroom supports the following regions:cn : Mainland China.ap : Asia Pacific.eu : Europe.na : North America. |
appId |
String | (Required) Agora App ID. |
https://api.agora.io/edu/polling/apps/{yourappId}/v2/rooms/sequences
Parameter | Type | Description |
---|---|---|
code |
Integer | Business status code: |
msg |
String | The detailed information. |
ts |
Number | The current Unix timestamp (in milliseconds) of the server in UTC. |
data |
Object | Include the following parameters:roomUuid : String, the classroom ID.cmd : Integer, the event type. For details, see Flexible Classroom Cloud Service Events.sequence : Integer. The event ID. This is the unique identifier of an event, which is automatically generated to ensure the order of events.version : Integer, the service version.data : Object, the detailed data of the event. The data varies depending on the event type. For details, see Flexible Classroom Cloud Service Events. |
"status": 200,
"body":
{
"msg": "Success",
"code": 0,
"ts": 1610167740309,
"data":[
{
"roomUuid": "xxxxxx",
"cmd": 20,
"sequence": 1,
"version": 1,
"data":{}
}
]
}
Add or update the custom properties of a specified classroom. For details, see How can I set user properties and classroom properties?
URL parameters
Pass the following parameters in the URL.
Parameter | Type | Description |
---|---|---|
region |
String | (Required) The region for connection. For details, see Network geofencing. Flexible Classroom supports the following regions:cn : Mainland China.ap : Asia Pacific.eu : Europe.na : North America. |
appId |
String | (Required) Agora App ID. |
roomUuid |
String | (Required) The classroom ID. This is the globally unique identifier of a classroom. It is also used as the channel name when a user joins an RTC or RTM channel. The string length must be less than 64 bytes. Supported character scopes are: |
Request body parameters
Pass in the following parameters in the request body.
Parameter | Type | Description |
---|---|---|
properties |
Object | Classroom properties. |
cause |
Object | The update reason. |
Request Body
{
"properties" :{
"key1":"value1",
"key2":"value2"
},
"cause":{}
}
Parameter | Type | Description |
---|---|---|
code |
Integer | Business status code: |
msg |
String | The detailed information. |
ts |
Number | The current Unix timestamp (in milliseconds) of the server in UTC. |
{
"msg": "Success",
"code": 0,
"ts": 1610167740309
}
Delete the custom properties of a specified classroom. For details, see How can I set user properties and classroom properties?
URL parameters
Pass the following parameters in the URL.
Parameter | Type | Description |
---|---|---|
region |
String | (Required) The region for connection. For details, see Network geofencing. Flexible Classroom supports the following regions:cn : Mainland China.ap : Asia Pacific.eu : Europe.na : North America. |
appId |
String | (Required) Agora App ID. |
roomUuid |
String | (Required) The classroom ID. This is the globally unique identifier of a classroom. It is also used as the channel name when a user joins an RTC or RTM channel. The string length must be less than 64 bytes. Supported character scopes are: |
Request body parameters
Pass in the following parameters in the request body.
Parameter | Type | Description |
---|---|---|
properties |
String array | Classroom properties. |
cause |
Object | Reason for deletion. |
Request Body
{
"properties" :[
"key1",
"key2"
],
"cause":{}
}
Parameter | Type | Description |
---|---|---|
code |
Integer | Business status code: |
msg |
String | The detailed information. |
ts |
Number | The current Unix timestamp (in milliseconds) of the server in UTC. |
{
"msg": "Success",
"code": 0,
"ts": 1610167740309
}
Add or update the custom properties of a specified user. For details, see How can I set user properties and classroom properties?
URL parameters
Pass the following parameters in the URL.
Parameter | Type | Description |
---|---|---|
region |
String | (Required) The region for connection. For details, see Network geofencing. Flexible Classroom supports the following regions:cn : Mainland China.ap : Asia Pacific.eu : Europe.na : North America. |
appId |
String | (Required) Agora App ID. |
roomUuid |
String | (Required) The classroom ID. This is the globally unique identifier of a classroom. It is also used as the channel name when a user joins an RTC or RTM channel. The string length must be less than 64 bytes. Supported character scopes are: |
userUuid |
String | (Required) The user ID. This is the unique identifier of the user and also the user ID used when logging in to the Agora RTM system. The string length must be less than 64 bytes. Supported character scopes are: |
Request body parameters
Pass in the following parameters in the request body.
Parameter | Type | Description |
---|---|---|
properties |
Object | The user properties. |
cause |
Object | The update reason. |
Request Body
{
"properties" :{
"key1":"value1",
"key2":"value2"
},
"cause":{}
}
Parameter | Type | Description |
---|---|---|
code |
Integer | Business status code: |
msg |
String | The detailed information. |
ts |
Number | The current Unix timestamp (in milliseconds) of the server in UTC. |
{
"msg": "Success",
"code": 0,
"ts": 1610167740309
}
Delete the custom properties of a specified user. For details, see How can I set user properties and classroom properties?
URL parameters
Pass the following parameters in the URL.
Parameter | Type | Description |
---|---|---|
region |
String | (Required) The region for connection. For details, see Network geofencing. Flexible Classroom supports the following regions:cn : Mainland China.ap : Asia Pacific.eu : Europe.na : North America. |
appId |
String | (Required) Agora App ID. |
roomUuid |
String | (Required) The classroom ID. This is the globally unique identifier of a classroom. It is also used as the channel name when a user joins an RTC or RTM channel. The string length must be less than 64 bytes. Supported character scopes are: |
userUuid |
String | (Required) The user ID. This is the unique identifier of the user and also the user ID used when logging in to the Agora RTM system. The string length must be less than 64 bytes. Supported character scopes are: |
Request body parameters
Pass in the following parameters in the request body.
Parameter | Type | Description |
---|---|---|
properties |
String array | The user properties. |
cause |
Object | Reason for deletion. |
Request Body
{
"properties" :[
"key1",
"key2"
],
"cause":{}
}
Parameter | Type | Description |
---|---|---|
code |
Integer | Business status code: |
msg |
String | The detailed information. |
ts |
Number | The current Unix timestamp (in milliseconds) of the server in UTC. |
{
"msg": "Success",
"code": 0,
"ts": 1610167740309
}
Add or update the properties of the extApp in a specified classroom.
URL parameters
Pass the following parameters in the URL.
Parameter | Type | Description |
---|---|---|
region |
String | (Required) The region for connection. For details, see Network geofencing. Flexible Classroom supports the following regions:cn : Mainland China.ap : Asia Pacific.eu : Europe.na : North America. |
appId |
String | (Required) Agora App ID. |
roomUuid |
String | (Required) The classroom ID. This is the globally unique identifier of a classroom. It is also used as the channel name when a user joins an RTC or RTM channel. The string length must be less than 64 bytes. Supported character scopes are: |
extAppUuid |
String | (Required) The extApp ID. The string length must be less than 64 bytes. Supported character scopes are: |
Request body parameters
Pass in the following parameters in the request body.
Parameter | Type | Description |
---|---|---|
properties |
Object | The user properties. |
common |
Object | The JSON object contains the following fields:state : Integer, the state of extApp. 0 means disabled, and 1 means enabled. |
cause |
Object | The update reason. |
Request Body
{
"properties" :{},
"common":{
"state":0
},
"cause":{}
}
Parameter | Type | Description |
---|---|---|
code |
Integer | Business status code: |
msg |
String | The detailed information. |
ts |
Number | The current Unix timestamp (in milliseconds) of the server in UTC. |
{
"msg": "Success",
"code": 0,
"ts": 1610167740309
}
Delete the properties of the extApp in a specified classroom.
URL parameters
Pass the following parameters in the URL.
Parameter | Type | Description |
---|---|---|
region |
String | (Required) The region for connection. For details, see Network geofencing. Flexible Classroom supports the following regions:cn : Mainland China.ap : Asia Pacific.eu : Europe.na : North America. |
appId |
String | (Required) Agora App ID. |
roomUuid |
String | (Required) The classroom ID. This is the globally unique identifier of a classroom. It is also used as the channel name when a user joins an RTC or RTM channel. The string length must be less than 64 bytes. Supported character scopes are: |
extAppUuid |
String | (Required) The extApp ID. The string length must be less than 64 bytes. Supported character scopes are: |
Request body parameters
Pass in the following parameters in the request body.
Parameter | Type | Description |
---|---|---|
properties |
String array | The user properties. |
cause |
Object | Reason for deletion. |
Request Body
{
"properties" :[
"key-path1",
"key-path2"
],
"cause":{}
}
Parameter | Type | Description |
---|---|---|
code |
Integer | Business status code: |
msg |
String | The detailed information. |
ts |
Number | The current Unix timestamp (in milliseconds) of the server in UTC. |
{
"msg": "Success",
"code": 0,
"ts": 1610167740309
}
URL parameters
Pass the following parameters in the URL:
Parameter | Type | Description |
---|---|---|
appId |
String | (Required) Agora App ID. |
roomUuid |
String | (Required) The classroom ID. This is the globally unique identifier of a classroom. It is also used as the channel name when a user joins an RTC or RTM channel. The string length must be less than 64 bytes. |
Query parameters
Parameter | Type | Description |
---|---|---|
nextId |
String | (Optional) The starting ID of the next batch of data. When you call this method to get the data for the first time, leave this parameter empty or set it as null. Afterward, you can set this parameter as the nextId that you get in the response of the previous method call. |
count |
Integer | (Optional) The number of pieces of data in this batch. The default value is 100. |
The fields returned in data
vary in different situations.
After the teacher clicks the Start button to start a quiz, the summarized data of the Pop-up Quiz widget updates. data
contains the following fields:
Field name | Type | Description |
---|---|---|
action | Integer | The action type |
changeProperties | Object | The changed properties |
changeProperties.extra | Object | The extra information of the changed properties |
changeProperties.extra.correctItems | Object[] | The correct choice |
changeProperties.extra.correctCount | Integer | The number of students who have made the correct choice |
changeProperties.extra.answerState | Integer | The status of this quiz:
|
changeProperties.extra.receiveQuestionTime | Long | The time when the students receive the question |
changeProperties.extra.popupQuizId | String | The question ID |
changeProperties.extra.averageAccuracy | Float | The rate at which the correct choice is made for this question |
changeProperties.extra.totalCount | Integer | The total number of students who have submitted their answers to this question |
changeProperties.extra.items | Object[] | The options of this question |
changeProperties.state | Integer | The state of the Pop-up Quiz widget:
1 : Active |
cause | String | The reason for the property change |
operator | Object | The operator of the property change |
operator.userUuid | String | The ID of the operator |
operator.userName | String | The name of the operator |
operator.role | String | The role of the operator |
After a student submits the answer, the student's data updates. data
contains the following fields:
Field name | Type | Description |
---|---|---|
action | Integer | The action type |
changeProperties | Object | The changed properties |
changeProperties.lastCommitTime | Long | The last submit time |
changeProperties.popupQuizId | String | The question ID |
changeProperties.selectedItems | Object[] | The answer submitted by this student |
changeProperties.isCorrect | Boolean | Whether the answer submitted by the student is correct |
cause | String | The reason for the property change |
operator | Object | The operator of the property change |
operator.userUuid | String | The ID of the operator |
operator.userName | String | The name of the operator |
operator.role | String | The role of the operator |
fromUser | Object | The user who starts this quiz |
fromUser.userUuid | String | The ID of the user who starts this quiz |
fromUser.userName | String | The name of the user who starts this quiz |
fromUser.role | String | The role of the user who starts this quiz |
After a student submits the answer, the summarized data of the Pop-up Quiz widget updates. data
contains the following fields:
Field name | Type | Description |
---|---|---|
action | Integer | The action type |
changeProperties | Object | The changed properties |
changeProperties.extra | Object | The extra information of the changed properties |
changeProperties.extra.selectedCount | Integer | The number of students who have submitted their answers |
changeProperties.extra.correctCount | Integer | The number of students who have made the correct choice |
changeProperties.extra.averageAccuracy | Float | The rate at which the correct choice is made for this question |
changeProperties.extra.totalCount | Integer | The total number of students who have submitted their answers to this question |
cause | String | The reason for the property change |
operator | Object | The operator of the property change |
operator.userUuid | String | The ID of the operator |
operator.userName | String | The name of the operator |
operator.role | String | The role of the operator |
After the teacher ends the quiz, the summarized data of the Pop-up Quiz widget updates. data
contains the following fields:
Field name | Type | Description |
---|---|---|
action | Integer | The action type |
changeProperties | Object | The changed properties |
changeProperties.extra | Object | The extra information of the changed properties |
changeProperties.extra.selectedCount | Integer | The number of students who have submitted their answers |
changeProperties.extra.correctCount | Integer | The number of students who have made the correct choice |
changeProperties.extra.answerState | Integer | The status of this quiz:
|
changeProperties.extra.averageAccuracy | Float | The rate at which the correct choice is made for this question |
changeProperties.extra.totalCount | Integer | The total number of students who have submitted their answers to this question |
cause | String | The reason for the property change |
operator | Object | The operator of the property change |
operator.userUuid | String | The ID of the operator |
operator.userName | String | The name of the operator |
operator.role | String | The role of the operator |
After the teacher clicks the Start button to start a quiz, the summarized data of the Pop-up Quiz widget updates:
"action": NumberInt("1"),
"changeProperties": {
"extra.correctItems": [
"A",
"B",
"D"
],
"extra.totalCount": NumberInt("1"),
"extra.answerState": NumberInt("1"),
"state": NumberInt("1"),
"extra.popupQuizId": "ab5b183238a74d5a9c955dc87c6397e0",
"extra.averageAccuracy": 0,
"extra.correctCount": NumberInt("0"),
"extra.items": [
"A",
"C",
"B"
],
"extra.receiveQuestionTime": NumberLong("1652413962895")
},
"operator": {
"userName": "server",
"userUuid": "server",
"role": "server"
}
After a student submits the answer, the student's data updates:
"action": NumberInt("1"),
"changeProperties": {
"selectedItems": [
"A",
"B",
"D"
],
"isCorrect": true,
"popupQuizId": "ab5b183238a74d5a9c955dc87c6397e0",
"lastCommitTime": NumberLong("1652413989997")
},
"fromUser": {
"userName": "yerongzhe2",
"userUuid": "yerongzhe22",
"role": "audience"
}
After the teacher ends the quiz, the summarized data of the Pop-up Quiz widget updates:
"action": NumberInt("1"),
"changeProperties": {
"extra.totalCount": NumberInt("1"),
"extra.answerState": NumberInt("0"),
"extra.selectedCount": NumberInt("1"),
"extra.averageAccuracy": 1,
"extra.correctCount": NumberInt("1")
},
"operator": {
"userName": "server",
"userUuid": "server",
"role": "server"
}
URL parameters
Pass the following parameters in the URL:
Parameter | Type | Description |
---|---|---|
appId |
String | (Required) Agora App ID. |
roomUuid |
String | (Required) The classroom ID. This is the globally unique identifier of a classroom. It is also used as the channel name when a user joins an RTC or RTM channel. The string length must be less than 64 bytes. |
Query parameters
Parameter | Type | Description |
---|---|---|
nextId |
String | (Optional) The starting ID of the next batch of data. When you call this method to get the data for the first time, leave this parameter empty or set it as null. Afterward, you can set this parameter as the nextId that you get in the response of the previous method call. |
count |
Integer | (Optional) The number of pieces of data in this batch. The default value is 100. |
The fields returned in data
vary in different situations.
After the teacher clicks the Start button to start a poll, the summarized data of the Polling widget updates. data
contains the following fields:
Field name | Type | Description |
---|---|---|
action | Integer | The action type |
changeProperties | Object | The changed properties |
changeProperties.extra | Object | The extra information of the changed properties |
changeProperties.extra.mode | Integer | The polling mode:
|
changeProperties.extra.pollingState | Integer | The status of this poll:
|
changeProperties.extra.pollDetails | Map<String, Object> | The polling results. key is the option index, starting from 0 . |
changeProperties.extra.pollDetails.num | Integer | The number of students who have selected this option |
changeProperties.extra.pollDetails.percentage | Float | The percentage of students who have selected this option in students who have submitted their choices |
changeProperties.extra.pollId | String | The poll ID |
changeProperties.extra.pollItems | Object[] | The option content |
changeProperties.state | Integer | The state of the Polling widget:
1 : Active |
cause | String | The reason for the property change |
operator | Object | The operator of the property change |
operator.userUuid | String | The ID of the operator |
operator.userName | String | The name of the operator |
operator.role | String | The role of the operator |
After a student submits the choice, the student's data updates. data
contains the following fields:
Field name | Type | Description |
---|---|---|
action | Integer | The action type |
changeProperties | Object | The changed properties |
changeProperties.extra | Object | The extra information of the changed properties |
changeProperties.extra.pollId | String | The poll ID |
changeProperties.extra.selectIndex | Object[] | The index of the option selected by this student |
cause | String | The reason for the property change |
operator | Object | The operator of the property change |
operator.userUuid | String | The ID of the operator |
operator.userName | String | The name of the operator |
operator.role | String | The role of the operator |
fromUser | Object | The user who starts this poll |
fromUser.userUuid | String | The ID of the user who starts this poll |
fromUser.userName | String | The name of the user who starts this poll |
fromUser.role | String | The role of the user who starts this poll |
After a student submits the answer, the summarized data of the Polling widget updates. data
contains the following fields:
Field name | Type | Description |
---|---|---|
action | Integer | The action type |
changeProperties | Object | The changed properties |
changeProperties.extra | Object | The extra information of the changed properties |
changeProperties.extra.pollDetails | Map<String, Object> | The polling results. key is the option index, starting from 0 . |
changeProperties.extra.pollDetails.num | Integer | The number of students who have selected this option |
changeProperties.extra.pollDetails.percentage | Float | The percentage of students who have selected this option in students who have submitted their choices |
changeProperties.extra.pollId | String | The poll ID |
cause | String | The reason for the property change |
operator | Object | The operator of the property change |
operator.userUuid | String | The ID of the operator |
operator.userName | String | The name of the operator |
operator.role | String | The role of the operator |
After the teacher ends the poll, the summarized data of the Polling widget updates. data
contains the following fields:
Field name | Type | Description |
---|---|---|
action | Integer | The action type |
changeProperties | Object | The changed properties |
changeProperties.extra | Object | The extra information of the changed properties |
changeProperties.extra.pollingState | Integer | The status of this poll:
|
changeProperties.extra.pollDetails | Map<String, Object> | The polling results. key is the option index, starting from 0 . |
changeProperties.extra.pollDetails.num | Integer | The number of students who have selected this option |
changeProperties.extra.pollDetails.percentage | Float | The percentage of students who have selected this option in students who have submitted their choices |
changeProperties.extra.pollId | String | The poll ID |
cause | String | The reason for the property change |
operator | Object | The operator of the property change |
operator.userUuid | String | The ID of the operator |
operator.userName | String | The name of the operator |
operator.role | String | The role of the operator |
After the teacher clicks the Start button to start a poll, the summarized data of the Polling widget updates:
"action": NumberInt("1"),
"changeProperties": {
"extra.pollId": "e556ce3df5cd4c23941b03bf54d29ba3",
"extra.pollState": NumberInt("1"),
"extra.pollItems": [
"aaa",
"bbb",
"ccc",
"ddd",
"eee"
],
"extra.mode": NumberInt("2"),
"state": NumberInt("1"),
"extra.pollDetails": {
"0": {
"num": NumberInt("0"),
"percentage": 0
},
"1": {
"num": NumberInt("0"),
"percentage": 0
},
"2": {
"num": NumberInt("0"),
"percentage": 0
},
"3": {
"num": NumberInt("0"),
"percentage": 0
},
"4": {
"num": NumberInt("0"),
"percentage": 0
}
}
},
"operator": {
"userName": "server",
"userUuid": "server",
"role": "server"
}
After a student submits the choice, the student's data updates:
"action": NumberInt("1"),
"changeProperties": {
"pollId": "e556ce3df5cd4c23941b03bf54d29ba3",
"selectIndex": [
NumberInt("1"),
NumberInt("2"),
NumberInt("4")
]
},
"fromUser": {
"userName": "yerongzhe2",
"userUuid": "yerongzhe22",
"role": "audience"
},
"operator": {
"userName": "server",
"userUuid": "server",
"role": "server"
}
After a student submits the choice, the summarized data of the Polling widget updates:
"action": NumberInt("1"),
"changeProperties": {
"extra.pollId": "2f38e6de32064713adf135de41c963df",
"extra.pollDetails": {
"0": {
"num": NumberInt("1"),
"percentage": 0.33333334
},
"1": {
"num": NumberInt("3"),
"percentage": 1
},
"2": {
"num": NumberInt("3"),
"percentage": 1
},
"3": {
"num": NumberInt("0"),
"percentage": 0
},
"4": {
"num": NumberInt("2"),
"percentage": 0.6666667
}
}
},
"operator": {
"userName": "server",
"userUuid": "server",
"role": "server"
}
After the teacher ends the poll, the summarized data of the Polling widget updates:
"action": NumberInt("1"),
"changeProperties": {
"extra.pollId": "2f38e6de32064713adf135de41c963df",
"extra.pollDetails": {
"0": {
"num": NumberInt("1"),
"percentage": 0.33333334
},
"1": {
"num": NumberInt("3"),
"percentage": 1
},
"2": {
"num": NumberInt("3"),
"percentage": 1
},
"3": {
"num": NumberInt("0"),
"percentage": 0
},
"4": {
"num": NumberInt("2"),
"percentage": 0.6666667
}
}
},
"operator": {
"userName": "server",
"userUuid": "server",
"role": "server"
}
Response status code | Business status code | Description |
---|---|---|
200 | 0 | The request succeeds. |
400 | 400 | The request parameter is incorrect. |
401 | N/A | Possible reasons:x-agora-uid or x-agora-token . |
403 | 30403200 | The classroom is muted globally. Users cannot send chat messages. |
404 | N/A | The server cannot find the requested resource. |
404 | 20404100 | The classroom does not exist. |
404 | 20404200 | The user does not exist. |
409 | 30409410 | The recording has not been started. |
409 | 30409411 | The recording has not been ended. |
409 | 30409100 | The class has been started. |
409 | 30409101 | The class has been ended. |
500 | 500 | The server has an internal error and cannot process the request. |
503 | N/A | Internal server error. The gateway or proxy server does not receive a timely response from the upstream server. |