Service URL/v3/push/package/upload
Parameter | Type | Required | Description |
file | form-data | Yes | Token package file name: [1, 100] characters Token package format and size: .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 POSThttps://api.tpns.tencent.com/v3/push/package/upload-H 'Authorization: Basic application authorization information'-F 'file=@C:\\Absolute path of the uploaded file'
import requestsurl = "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'))
Was this page helpful?