tencent cloud

Feedback

Account Package Upload API

Last updated: 2021-12-27 17:54:34

    API Description

    Request method: POST

    Service URL/v3/push/package/upload
    

    API service URLs correspond to service access points one to one. Please select the service URL corresponding to the service access point of your application.

    Feature: you can upload a package of multiple accounts and push to the accounts in batches. The two main APIs used are the account package upload API and the account package push API.

    Note:

    • Account package file name: [1, 100] characters
    • Account package format and size: .zip, .txt, or .csv file within 100 MB
    • .zip file requirements: can contain single .txt or .csv files but not folders
    • .txt file requirements: encoded in UTF-8; one account ([2, 100] characters) per row
    • .csv file requirements: one column only; one account ([2, 100] characters) per row

    Request Parameters

    Parameter Type Required Description
    file form-data Yes
  • Account package format and size: .zip, .txt, or .csv file within 100 MB
  • .zip file requirements: can contain single .txt or .csv files but not folders
  • .txt file requirements: encoded in UTF-8; one account ([2, 100] characters) per row
  • .csv file requirements: one column only; one account ([2, 100] characters) per row
  • Response Parameters

    Parameter Type Required Description
    retCode Integer Yes Error code
    errMsg String Yes Error message of a request error
    uploadId Integer Yes When a file is uploaded, a positive integer is returned, which represents the ID of the uploaded file (uploadId). It is provided to the push API for account package push.

    Sample Request

    import base64
    from pip._vendor import requests
    from pip._vendor.urllib3 import encode_multipart_formdata

    def upload(url, filePath, accessId, secret, data={}, header={}):
    openFile = open(filePath, 'rb')
    data['file'] = (openFile.name, openFile.read())
    encode_data = encode_multipart_formdata(data)
    data = encode_data[0]
    header['Content-Type'] = encode_data[1]
    authInfo = accessId + ":" + secret

    header['Authorization'] = "Basic " + str(base64.b64encode(bytes(authInfo, encoding="utf8")),encoding="utf8")

    r = requests.post(url, headers=header, data=data)
    print(r.json())

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support