Cloud Delete Template using Python

This example shows how to delete a template from the cloud using Python.  It calls the Docmosis REST API to delete a template file on the cloud.

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.

import json
import requests
import datetime
 
accessKey='XXX'
 
if accessKey=='XXX':
  print("Please set your access key")
  exit()
 
payload = {"accessKey":accessKey, "templateName":"tt.doc"}

headers = {'content-type': 'application/x-www-form-urlencoded'}

r = requests.post("https://dws2.docmosis.com/services/rs/deleteTemplate", data=payload, headers = headers)

if r.status_code == requests.codes.ok:
 
  print("template deleted");
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) - - DWS2