Python – PUT data to a URL (Edit docusign recipient)

Wanted to submit a PUT request to a URL. The requests module in Python is the one recommended to do so. Can be easily downloaded using:

pip install requests


easy_install requests

More ways to install:

Post installation, here’s a snippet to PUT data to a URL (this specific example shows how to Edit an existing docusign recipient):

import sys, json, urllib, urllib2, requests
import base64
# enter your info:
username = ""
password = "YouP@ssword"
integratorKey = "YOUR-integration-key"

authenticateStr = "<DocuSignCredentials>" \
                    "<Username>" + username + "</Username>" \
                    "<Password>" + password + "</Password>" \
                    "<IntegratorKey>" + integratorKey + "</IntegratorKey>" \

# STEP 1 - Login
url = ''
payload = {
  "signers" :
      "email": "",
      "name": "New Recipient",
      "recipientId": "2"
headers = {'X-DocuSign-Authentication': authenticateStr, 'Accept': 'application/json'}
req = requests.put(url, data = json.dumps(payload), headers=headers)
print req
print req.status_code
print req.content

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s