After you get a batch of user accounts from a third-party data platform or business backend, when launching a marketing campaign for such users, you can use the push to accounts feature to push messages to a single or multiple accounts at a time.
Note:The abovementioned accounts must be bound with a Tencent Push Notification Service token. For detailed directions, please see Binding an account (Android) or Adding account (iOS).
Note:Requirements for the uploaded account package:
- Account package filename: [1, 100] characters
- Account package format and size:
.zip
,.txt
, or.csv
file within 100 MB.zip
file requirements: can contain a single.txt
or.csv
file but not folders.txt
file requirements: encoded in UTF-8; one account ([2, 100] characters) per row.csv
file requirements: one column only; one account ([2, 100] characters) per row
When you call the push API, set audience_type
(push target) to account
(single account) or account_list
(a list of accounts) and enter a proper account type as instructed in Account Type Value Table.
{
"audience_type": "account",
"account_list": [
"123456"
],
"account_type":1,
"account_push_type":0,
"message_type": "notify",
"message": {
"title": "Congrats on winning in the campaign",
"content":"Get online to claim your prize!"
}
}
Step 1. Call the API for uploading an account package file
Upload your account package file as instructed in Account Package Upload API. After the call succeeds, an upload_id
will be returned, such as 11231
.
Step 2. Call the push API
audience_type
(push target) to package_account_push
(push to accounts in the package).upload_id
obtained in Step 1, such as 11231
.account_push_type
to specify whether to push to the recent or all devices bound to each account.The following sample pushes a message to users who have won prizes in a marketing campaign:
{
"audience_type": "package_account_push",
"upload_id": 11231,
"account_type":1,
"account_push_type":0,
"message_type": "notify",
"message": {
"title": "Congrats on winning in the campaign",
"content":"Get online to claim your prize!"
}
}
Was this page helpful?