UserID-Targeted Push
Overview
Push notifications are sent to a specified list of recipient accounts. The recipient account list must include between 1 and 500 accounts.
API Call Instructions
Request URL Example
https://xxxxxx/v4/timpush/webbatch?usersig=xxx&identifier=admin&sdkappid=88888888&random=99999999&contenttype=json
Query Parameters
Parameter | Description |
https | Request protocol: HTTPS. Request method: POST. |
xxxxxx | Domain specific to the region associated with your SDKAppID. Singapore: adminapisgp.im.qcloud.comSeoul: adminapikr.im.qcloud.comTokyo: adminapijpn.im.qcloud.comFrankfurt: adminapiger.im.qcloud.comSilicon Valley: adminapiusa.im.qcloud.comJakarta: adminapiidn.im.qcloud.comRiyadh: adminapiksa.im.qcloud.com |
v4/timpush/webbatch | Request endpoint. |
usersig | |
identifier | |
sdkappid | SDKAppID assigned by the Chat Console when creating the application. |
random | Random 32-bit unsigned integer, range 0 - 4294967295. |
contenttype | Fixed value: json. |
Call Rate
Trial Edition: 30 users/second; Standard Edition: 500 users/second.
Request Example
{"From_Account": "administrator","To_Account": ["user1","user2"], // Array size must be between [1,500]"MsgRandom": 3674128,"WebInfo": {"Title": "Offline Push Title","Desc": "Offline Push Content"}}
Request Fields
Field | Type | Required | Description |
From_Account | String | Required | Sender account. |
To_Account | Array | Required | Recipient account list. |
MsgRandom | Integer | Required | Random 32-bit unsigned integer, range 0 - 4294967295. Used by the backend to deduplicate messages within the same second. Ensure this is a random number. |
WebInfo | Object | Optional | Pushes to the browser notification bar. For details, see Common Parameters (WebInfo and Message field description). At least one of WebInfo or Message must be provided. If only WebInfo is present, only browser notification bar push will be displayed. If only Message is present, online push is received only when the web page remains open. If both WebInfo and Message are present, Message push is received online, WebInfo system notification bar push is received offline. |
Message | Object | Optional | |
DataId | String | Optional | Custom business identifier. This field is passed through to the App backend in the webhook. Maximum size is 64 bytes. |
TaskName | String | Optional | Custom push task name, corresponding to the task name in the Push Management section of the console. This field is limited to 20 bytes. |
Response Example
{"ActionStatus": "OK","ErrorInfo": "","ErrorCode": 0,"TaskId": "wbat@1_6943e4b7_669462cf_2000012099531ab_4bfee607_3dbc55"}
Response Fields
Field | Type | Description |
ActionStatus | String | Status of the request: OK indicates success. FAIL indicates failure. |
ErrorCode | Integer | Error code. |
ErrorInfo | String | Error message. |
TaskId | String | Push task ID. |
Error Codes
Unless a network error occurs (such as a 502 error), this API always returns HTTP status code 200. Actual errors are indicated by ErrorCode and ErrorInfo in the response body. For common error codes (60000 to 79999), refer to the Error Codes documentation.
Private error codes specific to this API are listed below:
Error Code | Description |
90001 | Failed to parse JSON format. Check that your request payload conforms to the JSON specification. |
90009 | App administrator privileges are required for this request. |
90045 | Global, tag, or individual push features are not enabled. |
90057 | Custom business identifier DataId is too long. Maximum supported length is 64 bytes. |
91000 | Internal service error. Please retry. |
