Internal Server Error when creating sending_requests

  • 1
  • Problem
  • Updated 2 weeks 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 = 'https://api.rightsignature.com/public/v1/sending_requests'
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": "foo@bar.com"
}]
},
"sending_request": {},
}
response = requests.post(url, json=data, headers=headers, timeout=10)

print(response.json())

The response I get is:

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

Any help in resolving this would be appreciated.

Thanks,
Photo of Gavin O'Connor

Gavin O'Connor

  • 3 Posts
  • 0 Reply Likes

Posted 3 weeks ago

  • 1
Photo of Saravanan Kannan

Saravanan Kannan, Employee

  • 50 Posts
  • 8 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

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

b64encode(API_TOKEN) 

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.