Request method: POST
Service URL/v3/push/package/upload
API service URLs correspond to service access points one by one. Please select the service URL corresponding to the service access point of your application.
Feature: you can upload a token package file for a batch of device tokens, and messages will be pushed by the tokens in it.
Parameter | Type | Required | Description |
---|---|---|---|
file | form-data | Yes | .zip , .txt , or .csv file within 100 MB.zip file requirements: contains a single .txt or .csv file but not folders.txt file requirements: encoded in UTF-8; one token (36 characters) per row.csv file requirements: one column only; one token (36 characters) per row |
Parameter | Type | Required | Description |
---|---|---|---|
retCode | Integer | Yes | Error code |
errMsg | String | Yes | Error message when a request error occurs |
uploadId | Integer | Yes | When a file is uploaded, uploadId is provided as a positive integer, which represents the ID of the uploaded file. It is provided to the push API for token package push. |
curl -X POST
https://api.tpns.tencent.com/v3/push/package/upload
-H 'Authorization: Basic application authorization information'
-F 'file=@C:\Absolute path of the uploaded file'
import requests
url = "https://api.tpns.tencent.com/v3/push/package/upload"
files = {'file':open('file name', 'rb')}
upload_data={"fileName": "absolute file address"}
headers = {
'Authorization': "Basic application authorization information",
}
response = requests.request("POST", url, data=upload_data, headers=headers, files=files, verify=False)
print(response.text.encode('utf-8'))
Note:
For more information on the application authorization, please see Basic Auth Verification.
Was this page helpful?