Number Package Upload API

Last updated: 2020-07-15 12:04:23

    API Description

    Request method: POST.

    The API request address corresponds to the service access point one by one; therefore, please select the request address corresponding to your application service access point.

    Service access point in Guangzhou:

    Service access point in Hong Kong (China):

    Service access point in Singapore:

    Feature: 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 only contains UTF-8-encoded txt files.
    • Each line in a txt file represents one account, and the account length is limited to [2, 100].

    Parameter Description

    Request parameters

    Parameter Name Type Required Description
    file form-data Yes Uploaded files must be zip files less than 100 MB. Each .zip file only contains UTF-8-encoded txt files, without any 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 Integer Yes Error code
    errMsg String Yes Error message when an error occurs in the request
    uploadId Integer 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: basic application authorization information' 
    -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' 
    -F 'file=@C:\File upload with 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 application authorization information",
    response = requests.request("POST", url, data=httpBody, headers=headers, verify=False)

    For application authorization information, please see Basic Auth Authentication.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback