Register Bots
Description
Call this interface to register multiple bots.
Request method and endpoint
- Request method:POST
- Request endpoint:
https://zim-api.zego.im/?Action=RobotRegister
- Transfer protocol:HTTPS
- QPS limit:20 times/second
Request parameters
The following table describes only the method-specific request parameters and some common request parameters. For the complete list of common request parameters, see Accessing Server APIs - Common request parameters.
Parameter | Type | Required | Description |
---|---|---|---|
UserInfo | Array Of Object | Yes | List of bot user information. A maximum of 20 bots can be registered at once. |
└UserId | String | Yes | Bot user ID. Length cannot exceed 32 bytes and must start with @RBT#. |
└UserName | String | No | Bot name. Length cannot exceed 256 bytes. |
└UserAvatar | String | No | Bot avatar URL. Length cannot exceed 500 bytes. |
Request example
-
Request URL:
Untitledhttps://zim-api.zego.im/?Action=RobotRegister &<Common request parameters>
1 -
Request body:
Untitled{ "UserInfo":[ { "UserId": "@RBT#R1", "UserName": "userNameA", "UserAvatar": "https" }, { "UserId": "@RBT#R2", "UserName": "userNameB", "UserAvatar": "https" } ] }
1
Response parameters
Parameter | Type | Description |
---|---|---|
Code | Number | Return code. Note When you register multiple bots at once:
|
Message | String | Description of the operation result. |
RequestId | String | Request ID. |
ErrorList | Object | List of failure information.
|
└UserId | String | The bot user ID that failed to register. |
└SubCode | Number | The specific return code for bot registration failure. |
└SubMessage | String | The reason for bot registration failure. |
## Response example
Untitled
{
"Code": 0,
"Message": "success",
"RequestId": "343649807833778782"
}
1
Return Codes
Return Code | Description | Possible Reason | Solution |
---|---|---|---|
660000001 | A common service error occurred. | A server error occurred. | Try again, or contact ZEGOCLOUD technical support. |
660000002 | Invalid parameter. | The input parameter is invalid or not specified. | Check the input parameter. |
660300005 | The frequency of calling the API exceeds the AppID-level limit. | Please try again later, or refer to the relevant documentation for the call frequency. | |
660000012 | The length of the UserID parameter exceeds the limit. | The UserID parameter cannot exceed 32 bytes in length. | Make sure that the UserID parameter does not exceed 32 bytes. |
660700001 | Too many requests are sent. | More than 20 requests are sent per second. | Try again later. |
660700002 | The bot already exists. | The userID specified in the request has already been registered. | Make sure that the userID has not been registered before. |
660700006 | The length of the UserName parameter exceeds the limit. | The UserName parameter cannot exceed 256 bytes in length. | Make sure that the UserName parameter does not exceed 256 bytes. |
660700007 | The length of the UserAvatar parameter exceeds the limit. | The UserAvatar parameter cannot exceed 500 bytes in length. | Make sure that the UserAvatar parameter does not exceed 500 bytes. |