Cloud (DWS3) List Images using Python

This example shows how to list images stored in Docmosis Cloud using Python.  It calls the Docmosis REST API and returns a list of images in a json response.

The sample code includes the instructions to get started. You will need a Free Trial and then plug your Docmosis Cloud access key into the code below, then run.

# This example shows how to use Python to call the Docmosis Cloud service to listImages stored in an account

import requests
import json
import datetime

# Set your region url here.
# End-point in the USA
URL = 'https://us.dws3.docmosis.com/api/listImages'
# End-point in the EU
#URL = 'https://eu.dws3.docmosis.com/api/listImages'
# End-point in AUS
#URL = 'https://au.dws3.docmosis.com/api/listImages'

# Set your access key here. This is visible in your cloud account in the Docmosis Web Site.
# It is your key to accessing your service - keep it private and safe.
accessKey='XXX'

if accessKey=='XXX':
  print("Please set your access key")
  exit()

payload = {'accessKey': accessKey }

r = requests.post(URL, data = payload)

if r.status_code == requests.codes.ok:
  print("Succeeded");
  print(r.text)
else:
  print("Failed");
  print(r.text)

Feedback

Invalid Input

Sorry, this field will only accept letters and numbers, and not special characters, to limit spam.

Sorry, this field will only accept letters and numbers, and not special characters, to limit spam.

Invalid Input

Applies To

Docmosis-Java Tornado Cloud
Version(s) - - DWS3