Number Package Upload API

Last updated: 2020-03-24 18:07:08


API Description

Request method: POST.

Description: The user needs to upload number package files to batch accounts as files. The files in the number package must then be pushed. The number package push APIs mainly include the number package upload API and the number package push API.

  • Request files are uploaded in form-data format, and the key is the file.
  • The uploaded file must have a zip file extension, and the compressed contents must be a txt file.
  • Each line in a txt file represents one account, and the account length is limited to [2, 100].

Parameter Descriptions

Request Parameters

Parameter name Type Required Description
file form-data Yes Uploaded files must be zip files that are 100M or less in size. The contents of each zip file must be a txt file, and there can be no nested folders. Each line in a txt file represents one account, and the account length is limited to [2, 100].

Response Parameters

Parameter name Type Required Description
retCode int32_t Yes Error code
errMsg string Yes Error message when an error occurs in the request
uploadId int32 Yes When a file upload succeeds, a positive integer uploadId will be provided, which represents the ID of the uploaded file. It is provided for the push of the subsequent number package API.


Curl example

curl -X POST 

-H 'Authorization': "Verification Information of Basic App",
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' 
-F 'file=@C:\Uploaded file’s absolute path'

Python example

import requests

url = ""

data.append('--%s' % boundary)
data.append('Content-Disposition: form-data; name="file"; filename="File name"\r\n')
fr=open('File address')

data.append('--%s--\r\n' % boundary)
httpBody = '\r\n'.join(data)

headers = {
'content-type': "multipart/form-data,boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
    'Authorization': "Basic authorization information",
response = requests.request("POST", url, data=httpBody, headers=headers, verify=False)

For applied Verification information, see Basic Auth Verification Document.