Internal Server Error when creating sending_requests

  • 1
  • Problem
  • Updated 1 year ago
We are trying to use the sending_requests as a way of creating documents. Sending a very basic request keeps resulting in a 500 Internal Server Error though.

My python code is as follows (note: the way it is sent/handled works for all other API requests) and the payload is near enough the same as what is in the documentation.

headers = {
'Authorization': 'Basic %s'%b64encode(API_TOKEN),
'Content-type': 'application/json',
url = ''
data = {
"file": {
"name": "foo.pdf",
"source": "upload"
"document": {
"signer_sequencing": False,
"expires_in": 12,
"name": "Sign me",
"roles": [{
"name": "a",
"signer_name": "Signer A",
"signer_email": ""
"sending_request": {},
response =, json=data, headers=headers, timeout=10)


The response I get is:

{'status': 500, 'error': 'Internal Server Error'}

Any help in resolving this would be appreciated.

Photo of Gavin O'Connor

Gavin O'Connor

  • 9 Posts
  • 0 Reply Likes

Posted 1 year ago

  • 1
Photo of Saravanan Kannan

Saravanan Kannan, Software Engineer

  • 120 Posts
  • 15 Reply Likes
I do not see any problem with the request. I get a successful response for the same. One minor change I did was to encode the api token instead of the string interpolation as you have done.
Photo of Gavin O'Connor

Gavin O'Connor

  • 9 Posts
  • 0 Reply Likes
Thanks. That helped. As we are using Python 3, 


ended up as a bytestring and included the b'' in the authentication headers. I would have expected a 403 though as it was the wrong token rather than a 500. Would have been much easier to debug our side.