tencent cloud

Tencent Push Notification Service

Release Notes
Announcements
Features
SDK for Android
SDK for iOS
SDK for macOS
Product Introduction
Overview
Strengths
Use Cases
Global Deployment
Purchase Guide
Billing Overview
Purchase Directions
Billing Modes
Free Trial
Payment Overdue
Getting Started
Creating Products and Applications
Quick Integration with Android
Quick Integration with iOS
Creating a Push Task
Querying Push Records
Guidelines for Push Testing Methods
Product Restrictions
Operation Guide
Push Management
Advanced Push Features
Practical Tutorial
iOS Badge Feature Practice
API Documentation
Overview
API Overview
Call Method
Push APIs
Tag APIs
Account APIs
Statistics APIs
User Attribute APIs
Server-Side Error Codes
Server SDKs
API (Java)
SDK Documentation
Android Integration Guide
iOS Integration Guide
Client Integration Plugin
macOS Integration Guide
Users and Permissions
Quick Configuration
Advanced Custom Configuration
Resource Tag
Service Agreement
Service Level Agreement
FAQs
iOS
Android
Flutter
Others
Tencent Push Notification Service Policy
Privacy Policy
Data Processing and Security Agreement
Developer Agreement
Contact Us
Glossary

Account Binding and Unbinding

PDF
Focus Mode
Font Size
Last updated: 2024-01-17 14:26:44

API Calling Description

Request method: POST.
Service URL/v3/device/account/batchoperate
The API service address corresponds to the service access point one by one; therefore, please select the service address corresponding to your application service access point.
Feature: this is an async API that is only responsible for task issuance, with real-time operation currently unsupported.

Parameter description

Request parameters

Parameter
Type
Required
Description
operator_type
Integer
Yes
Operation type. Value range: [1, 5]
(Disused) 1: Bind a token to one more account.
2: Bind a token to another account in an overriding manner.
3: Unbind a token from multiple accounts.
4: Unbind a token from all accounts.
5: Unbind an account from all tokens.
account_list
Array
No
List of account IDs. This field is valid and required when operator_type is 5. Each element contains the account and account_type (for type setting) fields. Example:
[{"account":"926@126.com"},{"account":"1527000000"},{"account":"2849249569","account_type":9}]
token_list
Array
No
List of device IDs. This field is valid and required when operator_type is 4.
token_accounts
Array
No
This field is valid and required when operator_type is 1, 2, or 3. Up to 20 tokens can be set in each call. Each token_account consists of 1 token and 1 account_list.
Example:
[{"token":"token1","account_list":[{"account":"926@126.com"},{"account":"1527000000"}],
{"token":"token2","account_list":[{"account":"926@163.com",{"account":"1527000001"}]}]
account_type Integer
No
Account type, which can be selected during account binding. The default value is 0. For valid values, see Account Type Value Table.
-
Note:
As the token append account API was seldom used and confusing to developers, it had been disused since October 26, 2020. If you have used it before, it will be replaced by the Token clearAndAppendAccount API.
Only one account can be bound to an account type. If multiple accounts are bound to an account type, an account bound later will override the one bound earlier.

Response parameters

Parameter
Type
Description
ret_code
Integer
Error code. For more information, see Server-Side Error Codes.
err_msg
String
Error message.
result
Array
Operation status code corresponding to each token or account ["0","1008006"].

Samples

Sample request

(Disused) Bind a token to one more account
{
"operator_type": 1,
"token_accounts": [
{
"token": "token1",
"account_list": [
{
"account": "926@126.com"
},
{
"account": "1527000000"
}
]
},
{
"token": "token2",
"account_list": [
{
"account": "926@163.com"
},
{
"account": "1527000001"
}
]
}
]
}
Bind the token to another account in an overriding manner
{
"operator_type": 2,
"token_accounts": [
{
"token": "token1",
"account_list": [
{
"account": "926@126.com"
},
{
"account": "1527000000"
}
]
},
{
"token": "token2",
"account_list": [
{
"account": "926@163.com"
},
{
"account": "1527000001"
}
]
}
]
}
Unbind a token from an account
{
"operator_type": 3,
"token_accounts": [
{
"token": "token1",
"account_list": [
{
"account": "926@126.com"
},
{
"account": "1527000000"
}
]
},
{
"token": "token2",
"account_list": [
{
"account": "926@163.com"
},
{
"account": "1527000001"
}
]
}
]
}
Unbind the token from all accounts
{
"operator_type": 4,
"token_list": [
"token1",
"token2",
"token3"
]
}
Unbind an account from all tokens
{
"operator_type": 5,
"account_list": [
{
"account": "926@126.com"
},
{
"account": "1527000000"
}
]
}

Response example

Unbind a token from an account
{
"ret_code": 0,
"err_msg": "NO_ERROR",
"result": [
"0"
]
}


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback