Feature Description
The App admin can create battle through this API.
API Call Description
Request URL Sample:
https://xxxxxx/v4/live_engine_http_pk/create_battle?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json
Description Of Request Parameters
The table below only lists the parameters modified when this interface is called. For more details on other parameters, please refer to RESTful API Overview. |
xxxxxx | The exclusive domain name corresponding to the country/region of SDKAppID: China: console.tim.qq.com Singapore: adminapisgp.im.qcloud.com United States: adminapiusa.im.qcloud.com |
v4/live_engine_http_pk/create_battle | Request API |
sdkappid | The SDKAppID assigned by the Chat console when creating an application |
identifier | |
usersig | Signatures generated by the App admin account. For specific operations, see Generate UserSig |
random | Please enter a random 32-bit unsigned integer, value range 0 - 4294967295 |
contenttype | The request format has a fixed value of JSON. |
Maximum Call Frequency
200 times/second.
Request Packet Sample
Basic form
{
"FromRoomId":"pk-1",
"ToRoomIdList":["pk-2","pk-3"],
"Duration":60000,
"ExtensionInfo":"extension pk"
}
Request Packet Field Description
|
FromRoomId | String | Required | Caller's room ID in PK |
ToRoomIdList | String | Required | List of callee room IDs in PK |
Duration | Integer | Required | PK Duration |
ExtensionInfo | String | Optional | PK Information Extension Field |
Note:
Before initiating PK, ensure that all participating rooms are in a connected state. This API does not verify the connection status. When PK is initiated, the SDK will notify the room owners of all participating rooms.
Response Packet Body Sample:
Basic form
{
"ErrorCode": 0,
"ErrorInfo": "",
"ActionStatus": "OK",
"RequestId": "requestId-123-456",
"Response":{
"BattleId": "battleid1",
"Result": [
{
"RoomId": "pk-2",
"ResultCode": 0,
"ResultMessage": "",
},
{
"RoomId": "pk-3",
"ResultCode": 0,
"ResultMessage": "",
}
],
}
}
Response Packet Field Description
|
ErrorCode | Integer | Error code. 0 indicates success; non-zero indicates failure. |
ErrorInfo | String | Error message. |
ActionStatus | String | Result of request processing. OK indicates successful processing, FAIL indicates failure. |
RequestId | String | Unique request ID, returned with each request, needed for troubleshooting. |
BattleId | String | ID of this PK |
Result | Array | PK situation of the callee |
RoomId | String | Room ID |
ResultCode | Integer | Result: 0 indicates success, 3 indicates being in PK, and 5 indicates a system error. |
ResultMessage | String | PK Result Information |
Error Code Description
Unless a network error occurs (such as a 502 error), the HTTP return code of this API is always 200. The real error code and error message are in the response packet body.Represented by ErrorCode and ErrorInfo.
Common Error Codes (60000 to 79999) refer to Error Code documentation. The private error codes of this API are as follows:
|
100001 | Server internal error, please retry. |
100002 | The parameter is illegal. Check whether the request is correct according to the error description. |
100003 | The Room ID already exists. Please select another Room ID. |
100412 | All called rooms are in PK. Please try again later. |
100415 | The caller is in PK. Please try again later. |