Data Upload API Code Samples
Selection of code samples that demonstrate the use of the Data Upload API. Copy and edit these code samples to suit your needs.
When using the code samples, remember to replace:
- {vanity_name} with your tenant name
- {api_key} with your API key
- {security_token} with a valid security token
Use one of the following sample requests to send a file to Visier.
- cURL sample
- Python sample
Copy
                                                            
                                                        
                                                    Send a ZIP to Visier
                                                            curl --upload-file ./myfile.zip https://{vanity-name}.api.visier.io/v1/data/upload/files/yourfile.zip --location
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' Copy
                                                            
                                                        
                                                    Send a ZIP to Visier
                                                            import requests
url = 'https://vanity-name.api.visier.io/v1/data/upload/files/'
filename = 'yourfile.zip'
headers = {
    "apikey": "api_key",
    "cookie": "VisierASIDToken=security_token"
}
with open(filename, 'rb') as f:
    resp = requests.put(
        f"{url}{filename}",
        headers = headers,
        data = f.read(),
        allow_redirects = True
    )
print(resp.status_code)The response returns an empty 200 OK success response.
