Event Type | Event Name | Description |
Room events | The room started. | |
| The room ended. | |
| The room expired. | |
Recording events | The recording ended. | |
Member events | A user joined the room. | |
| A user left the room. | |
Document events | The transcoding of a document is finished. | |
| A document was created. | |
| A document was deleted. |
Sign = md5(CallbackKey+ExpireTime)Example:CallbackKey = NjFGoDEyExpireTime = 1614151508Sign = md5(NjFGoDEy1614151508) = b9454ab5a85f9b7ad36071f5688ed34d
ExpireTime
is the signature expiration time. If the time specified by ExpireTime
in a message notification has elapsed, the notification can be considered invalid. This can prevent network replay attacks. The format of this parameter is a decimal Unix timestamp, i.e., the number of seconds that have elapsed since 00:00 (UTC/GMT time) on January 1, 1970.package mainimport("crypto/md5""fmt")func main(){callbackKey := "NjFGoDEy"expire := 1614151508sign := fmt.Sprintf("%x", md5.Sum([]byte(callbackKey+fmt.Sprintf("%d", expire))))fmt.Printf(fmt.Sprintf("sign:%s", sign)) // sign:b9454ab5a85f9b7ad36071f5688ed34d}
String md5Str = DigestUtils.md5DigestAsHex("NjFGoDEy1614151508".getBytes());
# Python 3 code to demonstrate the# working of MD5 (string - hexadecimal)import hashlib# initializing stringstr2hash = "NjFGoDEy1614151508"result = hashlib.md5(str2hash.encode())# printing the equivalent hexadecimal value.print("sign:", end ="")print(result.hexdigest()) #sign:b9454ab5a85f9b7ad36071f5688ed34d
ExpireTime
parameter and the Sign
parameter, which you can use together with the callback key to determine whether the request is legitimate.Parameter | Type | Description |
Timestamp | Integer | The Unix timestamp (seconds) when the event occurred. |
ExpireTime | Integer | The Unix timestamp (seconds) when the signature expires. If the current time is later than the expiration time, the request can be considered invalid. |
Sign | String | The callback signature. You can use the method described above to determine whether the signature is correct and consequently whether the request is legitimate. |
SdkAppId | Integer | The application the event belongs to. |
EventType | String | See the descriptions of different callback types. |
EventData | JSON | See the descriptions of different callback types. |
POST xxxxxxxxxxxxxxx(user-callback-url)Content-Type: application/json; charset=utf-8Accept: application/json{"Timestamp":1679279232,"ExpireTime":1679279832,"Sign":"fbfd23733e6262f49e402247024fbc29", // See "Calculating the Callback Signature"."SdkAppId":3520371,"EventType":"RoomStart","EventData":{"RoomId":366317280}}
Response: HTTP STATUS CODE = 200. You need to add `JSON: {"error_code":0}` to the response.HTTP STATUS CODE 200 OKHTTP BODY:{"error_code":0}
Field | Type | Description |
RoomId | Integer | The room ID. |
{"Timestamp":1679279232,"ExpireTime":1679279832,"Sign":"fbfd23733e6262f49e402247024fbc29","SdkAppId":3520371,"EventType":"RoomStart","EventData":{"RoomId":366317280}}
Field | Type | Description |
RoomId | Integer | The room ID. |
{"Timestamp":1679279195,"ExpireTime":1679279795,"Sign":"696560af8fec9374b4cd58c6318c6448","SdkAppId":3520371,"EventType":"RoomEnd","EventData":{"RoomId":311601250}}
Field | Type | Description |
RoomId | Integer | The room ID. |
{"Timestamp":1679282220,"ExpireTime":1679282820,"Sign":"07e504e36a3738cf17a47f47b37c0d3c","SdkAppId":3520371,"EventType":"RoomExpire","EventData":{"RoomId":310096990}}
Field | Type | Description |
RoomId | Integer | The room ID. |
Duration | Integer | The recording duration (seconds). |
RecordUrl | String | The recording URL (HTTPS). |
RecordSize | Integer | The recording file size (bits). |
{"Timestamp":1679279203,"ExpireTime":1679279803,"Sign":"7ada1f46f27ce6f1cdeb22339d71e094","SdkAppId":3520371,"EventType":"RecordFinish","EventData":{"Duration":63,"RecordSize":698472,"RecordUrl":"https://xxxxxxx.vod2.myqcloud.com/xxxx/xxxxxxx/f0.mp4","RoomId":311601250}}
Field | Type | Description |
RoomId | Integer | The room ID. |
UserId | String | The user ID. |
{"Timestamp":1679279225,"ExpireTime":1679279825,"Sign":"6fcaf48026fe95d76d1615c44ea98ede","SdkAppId":3520371,"EventType":"MemberJoin","EventData":{"RoomId":366317280,"UserId":"2Lzh8d3Rw7zOlpEnNgHPe6HDiDn"}}
Field | Type | Description |
RoomId | Integer | The room ID. |
UserId | String | The user ID. |
{"Timestamp":1679279260,"ExpireTime":1679279860,"Sign":"03d41254d4ba7a05e13299a4841c3d99","SdkAppId":3520371,"EventType":"MemberQuit","EventData":{"RoomId":397322814,"UserId":"2NG5xjpnYLGo3bq1taJbItY1TPf"}}
Field | Type | Description |
DocumentId | String | The document ID. |
State | Integer | The document status. |
Result | String | The transcoding result. If the transcoding succeeded, this parameter is the URL of the transcoding output; if the transcoding failed, this parameter is the error code. |
Info | String | The transcoding information. |
Thumbnail | String | The thumbnail URL. A PowerPoint file usually has multiple thumbnails. The URL of the first thumbnail is thumbnail_url/1.jpg . |
{"Timestamp":1679281156,"ExpireTime":1679281756,"Sign":"1597c5c8aaafb623ece9d1690dc0e780","SdkAppId":3520371,"EventType":"DocumentTranscodeFinish","EventData":{"DocumentId":"sixkzoak","Info":"","Result":"https://xxx.cos.ap-shanghai.myqcloud.com/doc/xxxxxx/picture/","State":3,"Thumbnail":"https://xxxxx.cos.ap-shanghai.myqcloud.com/doc/xxxxx/thumbnail/"}}
Field | Type | Description |
DocId | String | The document ID. |
DocName | String | The document name. |
Owner | String | The user ID of the document's owner. |
DocSize | Integer | The file size (bytes). |
DocUrl | String | The document URL. |
Permission | Integer | The document access: 0 : Private; 1 : Public. |
{"Timestamp":1679281150,"ExpireTime":1679281750,"Sign":"44f0a2e422ede67100a1f419df3ef51c","SdkAppId":3520371,"EventType":"DocumentCreate","EventData":{"DocId":"sixkzoak","DocName":"test.pdf","DocSize":4162606,"DocUrl":"https://xxxx.cos.ap-shanghai.myqcloud.com/uploads/xxxxx/xxxxxx/xxxxxx.pdf","Owner":"2Lzh8d3Rw7zOlpEnNgHPe6HDiDn","Permission":0}}
Field | Type | Description |
DocId | String | The document ID. |
{"Timestamp":1679281184,"ExpireTime":1679281784,"Sign":"964ff6d9463280d6a3bd4f7416213be9","SdkAppId":3520371,"EventType":"DocumentDelete","EventData":{"DocId":"sixkzoak"}}
enableCallback = true
.Field | Type | Description |
RoomId | String | The room ID. |
TaskId | String | task ID( taskId in updateTask,which can be modified) |
CustomData | String | CustomData( content in updateTask) |
{"Timestamp": 1679281184,"ExpireTime": 1679281784,"Sign": "964ff6d9463280d6a3bd4f7416213be9","SdkAppId": 3520371,"EventType": "TaskUpdate","EventData": {"RoomId": "397322814","TaskId": "your-task-id","CustomData": "{\\"key1\\":\\"value1\\",\\"key2\\":\\"value2\\"}"}}
TCIC.SDK.instance.updateTask('your-task-id', // taskIdJSON.stringify({ key1: 'value1', key2: 'value2' }), // content-1, // durationfalse, // createOnly'', // bindingUsertrue, // enableCallback);
Was this page helpful?