unauthorized trying to create a document package with python.
Monday, October 22, 2018 at 06:42pmHello, I'm using python and trying to create a document package from the example I downloaded from the forums. I used the api key in my admin panel and replaced the api key but I'm still getting an unauthorized.
Also, is there a way to just send a template I have setup with Owner, and Signer1 with the rest api. I have the fields setup on a template and I would like to just set the signer1 data and send it to both parties?
also tried
https://sandbox.esignlive.com/api/packages
https://sandbox.e-signlive.com/api/packages
import requests import json import os #create and send package in one call url = "https://sandbox.e-signlive.com/api/packages" payload = json.dumps({"documents":[{"id":"_8nAQ9iRWqZ-C95ouB8aauVUMC0=","name":"NDA"}],"status":"DRAFT","type":"PACKAGE","roles":[{"type":"SIGNER","id":"Signer1","signers":[{"email":"[email protected]","firstName":"Grant","lastName":"Zukel","id":"Signer1"}],"name":"Signer1"}],"name":"NDA"}) dir_path = os.path.dirname(os.path.realpath(__file__)) dir_path = dir_path + '\\idevops\\static\\contracts\\nda.pdf' file = open(dir_path, 'rb') files = {'payload': payload,'file': file} headers = { 'Authorization': "myapikey", 'accept': "application/json" } response = requests.post(url, files=files, headers=headers, verify=False) print(response.text)
Reply to: unauthorized trying to create a document package with python.
Tuesday, October 23, 2018 at 07:29am'authorization': "Basic api_key",
instead of directly put your api key? As you noticed, it's using the HTTP Basic authentication as a credential to validate your api call. And about your scenario, do you want your owner to be a reviewer of the package(created by template)? Can you tell me more about your requirement so that we can find out some solutions. Hope this could help! Duo