V3 is fully based on HTTPS and no longer provides HTTP access.
V3 supports POST access and no longer provides GET access.
V3 uses HTTP Basic Authentication for access authorization. API requests can be done using common HTTP tools such as curl and Postman.
In V3, APIs are categorized according to business functions, including Push API, Tag API, Device API, and Tool API. The same URL is used for all APIs in one category to improve API usability.
V3 has improvements in functionality. A tool API for arrival statistics query is added, which is currently under beta test.
For V2, see the documentation at https://intl.cloud.tencent.com/document/product/1024/30744.
Note: It is recommended to use the V3 APIs, and V2 APIs may be discontinued in the future.
TPNS provides REST-compliant HTTP APIs for developers to remotely call the services provided by it.
The APIs are mainly divided into four categories:
|Push API||It includes various APIs used to push messages||Normal|
|Tag API||It includes various APIs used to add, delete, and query tags||Normal|
|Device API||It includes various APIs used to query and delete account||Implementing|
|Tool API||It includes various APIs used to locate problems and query other data||Implementing|
Basic authentication is used, i.e., adding a field (key-value pair) to the HTTP Header:
Authorization: Basic base64_auth_string
The generation algorithm for base64_auth_string is:
That is to add a colon after
APPID followed by
SECRETKEY to form a string and then perform
base64 encoding on the string.
SECRETKEY can be obtained in My apps > App configuration at the TPNS website.
|openapi.xg.qq.com||API domain name||None|
|class_path||Category of the API provided||Different APIs have different path names|
|method||Feature API name||Different feature APIs have different names|
messagefield in Push API.