rdediana

REST Python Example - unauthorised error

0 votes
Hello https://developer.esignlive.com/code-share/esignlive-rest-client-using-python/ looking at the python code, i'm trying to run one of the example application use cases. i'm simply grabbed my API key, and updated the sandbox API url parameters. from my observations, the remaining attributes (guid / doc_id / temp_id) are not required yet? any assistance and guidance would be greatly appreciated. client = EslClient('enVyZ1A3....4b0U4Tw==', 'https://sandbox.e-signlive.ca/api/') guid = '' doc_id = '' temp_id = '' guid_del = '' # test1 for creating package payload = codecs.open('package.json', 'r',encoding='utf8').read() print(payload) documents = {'file': open(os.getcwd()+'/document.pdf', 'rb').read()} print(client.create_package_multipart(payload, documents)) # test1 end Program Execution Results: /usr/local/Cellar/python/2.7.11/bin/python2.7 /Users/regandediana/PycharmProjects/esl272/esl.py { "status": "DRAFT", "roles": [{ "id": "signer1", "signers": [{ "email": "[email protected]", "firstName": "j", "lastName": "doe" }] }], "documents": [{ "description": "Some description", "approvals": [{ "role": "signer1", "fields": [{ "type": "SIGNATURE", "subtype": "FULLNAME", "page": 0, "top": 100.0, "left": 100.0, "width": 199.99978637695312, "height": 39.99995803833008 }] }], "name": "First document" }], "name": "PYTHON CREATE" } {"messageKey":"error.unauthorised.noSession","packageId":null,"entity":null,"technical":null,"code":401,"message":"Failed to retrieve Session","name":"Unauthorized"}

Approved Answer

Reply to: REST Python Example - unauthorised error

0 votes
Hey, Can you verify that you are indeed registered for the Canadian sandbox? When logging in through the web portal, what is the url you see? If you are on the US sandbox, the base url in your code should be "https://sandbox.esignlive.com/api" (no hyphen in esignlive). Let me know.
Haris Haidary OneSpan Technical Consultant

Reply to: REST Python Example - unauthorised error

0 votes
excellent! that was the issue! modified the URL to reference the US api path. cheers.

Reply to: REST Python Example - unauthorised error

0 votes
Good to hear :)
Haris Haidary OneSpan Technical Consultant

Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off