sending_request error: A file is required

  • 1
  • Question
  • Updated 4 months ago
I am trying to use the sending_request method with python, and it isn't recognizing the payload - just returns {"error": "A file is required"}

import requests
import json

token = 'THIS_IS_MY_PRIVATE_TOKEN'
url = 'https://api.rightsignature.com/public/v1/sending_requests'
headers = {'Authorization': 'Basic ' + token}
payload = {"document":{"name": "sign me","signer_sequencing": "false","expires_in": 30,"roles": [{"name": "a","signer_name": "Billy Joe","signer_email": "brentdgeorge1@gmail.com"}]},"file":{"name": "testing.pdf","source": "upload"},"sending_request": {}}

r = requests.post(url, headers = headers, data = json.dumps(payload))

Photo of Intern Scalar

Intern Scalar

  • 1 Post
  • 0 Reply Likes

Posted 5 months ago

  • 1
Photo of Saravanan Kannan

Saravanan Kannan, Software Engineer

  • 57 Posts
  • 10 Reply Likes
Hi,

You need to do modify your header to include the content type like this

headers = {'Authorization': 'Basic ' + token, 'Content-type': 'application/json'}

and also change signer sequencing value to False, instead of 'false'. 

Thanks
Saravanan