Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Working python file to create embedded echosign widget
import base64
import suds
import logging
url = ""
client = suds.client.Client(url, autoblend=True)
with open('/Users/bobspryn/Desktop/flowers.pdf', 'r') as f:
read_data =
wci = client.factory.create("ns17:WidgetCreationInfo")
fileInfo = client.factory.create("ns1:FileInfo")
fileInfo.fileName = "flowers.pdf"
fileInfo.url = ""
fileInfo.mimeType = None
# fileInfo.file = base64.b64encode(read_data)
fileInfoArray = client.factory.create("ns1:ArrayOfFileInfo")
fileInfoArray.FileInfo.append(fileInfo) = "Monkeys2"
wci.fileInfos = fileInfoArray
wci.securityOptions = None
wci.callbackInfo = None
wci.widgetCompletionInfo = None
wci.widgetAuthFailureInfo = None
wci.locale = None
wci.mergeFieldInfo = None
print wci
r = client.service.createEmbeddedWidget("YOURAPIKEY", None, wci)
print r.javascript
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment