Feedback

Pushing to All/Tagged Users

All Users Push and Tag Push enable you to deliver targeted messages to specific user segments based on tags, such as membership campaigns, regional notifications, and more. This approach helps increase user acquisition, conversion, and engagement throughout your operations. Delivery reports and self-service troubleshooting tools for push notifications are also supported.

Overview

Supports sending push notifications to all users.
Supports sending push notifications based on user tags.
Due to the large number of accounts involved in All Users Push and Tag Push, delivery may take some time. The duration depends on the total number of accounts.

API Call Instructions

Request URL Example

https://xxxxxx/v4/timpush/webpush?usersig=xxx&identifier=admin&sdkappid=88888888&random=99999999&contenttype=json

Query Parameters

Parameter
Description
https
Request protocol: HTTPS.
Request method: POST.
xxxxxx
Dedicated domain for the country/region associated with your SDKAppID.
Singapore: adminapisgp.im.qcloud.com
Seoul: adminapikr.im.qcloud.com
Tokyo:adminapijpn.im.qcloud.com
Frankfurt: adminapiger.im.qcloud.com
Silicon Valley: adminapiusa.im.qcloud.com
Jakarta: adminapiidn.im.qcloud.com
Riyadh: adminapiksa.im.qcloud.com
v4/timpush/webpush
API endpoint.
usersig
Signature generated by the App administrator account. See Generate UserSig.
identifier
Must be an App administrator account. For more information, see App Administrator.
sdkappid
SDKAppID assigned by the Chat console when creating the application.
random
Enter a random 32-bit unsigned integer in the range 0 - 4294967295.
contenttype
Fixed value: json.

Call Frequency

Trial Edition: 10 calls/day; Standard Edition: 100 calls/day. The interval between two pushes must be greater than 1 second.

Request Example

All Users Push Example

Administrator sends an All Users Push:
{
"From_Account": "administrator",
"MsgRandom": 3674128,
"WebInfo": {
"Title": "Offline Push Title",
"Desc": "Offline Push Content",
"Ext": "{\"entity\":{\"key1\":\"value1\",\"key2\":\"value2\"}}", // Pass-through field, push uses JSON formatted string
"URL": "https://xxx.com" // URL to redirect when push is clicked
}
}

Tag Push Example

Administrator sends a message to users tagged with both "Stock A" and "Stock B":
{
"From_Account": "administrator",
"MsgRandom": 124032,
"Condition": {
"TagsAnd": ["Stock A","Stock B"]
},
"WebInfo": {
"Title": "Offline Push Title",
"Desc": "Offline Push Content",
"Ext": "{\"entity\":{\"key1\":\"value1\",\"key2\":\"value2\"}}", // Pass-through field, push uses JSON formatted string
"URL": "https://xxx.com" // URL to redirect when push is clicked
}
}
Administrator sends a message to users tagged with either "Stock A" or "Stock B":
{
"From_Account": "administrator",
"MsgRandom": 124032,
"Condition": {
"TagsOr": ["Stock A","Stock B"]
},
"WebInfo": {
"Title": "Offline Push Title",
"Desc": "Offline Push Content",
"Ext": "{\"entity\":{\"key1\":\"value1\",\"key2\":\"value2\"}}", // Pass-through field, push uses JSON formatted string
"URL": "https://xxx.com" // URL to redirect when push is clicked
}
}
Administrator sends a message to users tagged with either "Stock A" or "Stock B", but not tagged with "Stock C" and "Stock D":
{
"From_Account": "administrator",
"MsgRandom": 124032,
"Condition": {
"TagsOr": ["Stock A","Stock B"],
"TagsNot": ["Stock C","Stock D"] // Final push scope: ("Stock A" or "Stock B") and not ("Stock C" and "Stock D")
},
"WebInfo": {
"Title": "Offline Push Title",
"Desc": "Offline Push Content",
"Ext": "{\"entity\":{\"key1\":\"value1\",\"key2\":\"value2\"}}", // Pass-through field, push uses JSON formatted string
"URL": "https://xxx.com" // URL to redirect when push is clicked
}
}

Request Fields

Field
Type
Required
Description
From_Account
String
Required
Account sending the message push (can specify any existing account)
MsgRandom
Integer
Required
32-bit unsigned integer random number, range 0 - 4294967295.
Used by backend to deduplicate messages within the same second. Please ensure this is a random number.
Condition
Object
Optional
Criteria for filtering the target user group. If Condition is not specified, the push will be sent to all users. See Condition description below.
WebInfo
Object
Optional
Browser notification bar push. For details, see Common Parameters (WebInfo and Message field description).
At least one of WebInfo or Message must be present.
If only WebInfo is present, push is shown only in the browser notification bar.
If only Message is present, online push is received only when the webpage is not closed.
If both WebInfo and Message are present, online users receive Message push, offline users receive WebInfo system notification bar push.
Message
Object
Optional
DataId
String
Optional
Custom business identifier. This field will be passed through to the App backend via webhook. Maximum length: 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.

Condition Field Description

Field
Type
Required
Description
TagsOr
String Array
Optional
Union of tag conditions. Array length must not exceed 10.
TagsAnd
String Array
Optional
Intersection of tag conditions. Array length must not exceed 10.
TagsNot
String Array
Optional
Complement of tag conditions (for multiple tags, first take the union, then take the complement of the result). Array length must not exceed 10.
Note:
We recommend not mixing tags and attributes, as the target audience can become ambiguous. Tag conditions and attribute conditions can be combined.
Example: "Condition" : {"TagAnd" : [ "tag1", "tag2"], "TagOr" : ["tag3", "tag4"], "TagNot" : ["tag5", "tag6"] }
First, calculate the result for "TagAnd": tag1 and tag2 = A;
Then, calculate the result for "TagOr": tag3 or tag4 = B;
Then, calculate the result for "TagNot": not (tag5 or tag6) = C;
The final result for "Condition" is A and B and C.

Response Example

{
"ActionStatus": "OK",
"ErrorInfo": "",
"ErrorCode": 0,
"TaskId": "wamp@1_6943e06f_669462cf_2000012099531ab_454fef10_47d6974d"
}

Response Fields

Field
Type
Description
ActionStatus
String
Result of request processing:
OK: Success.
FAIL: 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), the HTTP status code for this API is always 200. Actual error codes and messages are provided in the response body via ErrorCode and ErrorInfo. For common error codes (60000–79999), refer to the Error Codes documentation.
Private error codes for this API are as follows:
Error Code
Description
90001
JSON format parsing failed. Please check if the request body complies with JSON specification.
90005
MsgRandom field missing or not an Integer in the JSON request body.
90009
App administrator privileges required for this request.
90020
Tag length exceeds limit (must not exceed 50 bytes).
90022
Duplicate tags found in TagsOr and TagsAnd conditions.
90024
Push requests are too frequent. The interval between two pushes must be greater than 1 second.
90032
Number of tags in push conditions exceeds 10, or number of tags in add tag request exceeds 10.
90033
Invalid attribute.
90039
Attribute Push and Tag Push cannot coexist in the same request.
90040
One of the tags in push conditions is empty.
90045
All Users Push/Tag Push feature not enabled.
90047
Push count exceeds daily limit (default is 100 times).
90056
Request body for All Users Push is too large. Maximum supported length is 10K.
90057
Custom business identifier DataId is too long. Maximum supported length is 64 bytes.
91000
Internal service error. Please retry.