Can't successfully retrieve package id
Friday, July 14, 2017 at 04:36amHello,
i'm a junior developer and it has been my second week learning Node JS so errors might be because of my poor use of Javascript.
My problem is that after sending a request pretty much like in the example given on this link i get an undefined package id.
I suppose this is caused by un unvalid json payload or options objet. Here is my code.
The build of the json payload is done at line 23. I changed some of the values to make it look more like our webapp but since your example is quite basic i don't know if this is the problem ..
The http request to your API is done at line 234.
Thank you for your time.
Reply to: Can't successfully retrieve package id
Friday, July 14, 2017 at 06:29amReply to: Can't successfully retrieve package id
Friday, July 14, 2017 at 05:15am{ "roles": [ { "id": "Signer1", "type": "SIGNER", "signers": [ { "firstName": "lionel", "lastName": "jamaigne", "email": "[email protected]", "id": "Signer1" } ] }, { "id": "Sender1", "type": "SIGNER", "signers": [ { "firstName": "Haris", "lastName": "Haidary", "email": "[email protected]", "id": "Sender1" } ] } ], "documents": [ { "fields": [ { "value": "lionel", "name": "first_name" }, { "value": "jamaigne", "name": "last_name" }, { "value": "rue du truc", "name": "address" }, { "value": "martelange", "name": "city" }, { "value": "8832", "name": "zip" }, { "value": "saipas", "name": "state" }, { "value": "belgique", "name": "country" }, { "value": "32499463127", "name": "phone_number" }, { "value": "[email protected]", "name": "email" }, { "value": "docunify sa", "name": "company" }, { "value": "44", "name": "policy_number" } ], "name": "Sample Contract", "id": "contract", "extract": true } ], "name": "NodeJS Example", "type": "PACKAGE", "status": "DRAFT" }I was able to successfully create a package with the above payload. Also, make sure that you are using the same document I provided in my blog as the payload above is setup for the Document Extraction and Field Injection features.Reply to: Can't successfully retrieve package id
Friday, July 14, 2017 at 05:41amvar fs = require("fs"); var request = require("request"); var options = { method: 'POST', url: 'https://sandbox.esignlive.com/api/packages', headers: { accept: 'application/json; esl-api-version=11.0', authorization: 'Basic api_key', 'content-type': 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' }, formData: { payload: '{"roles":[{"id":"Signer1","type":"SIGNER","signers":[{"firstName":"lionel","lastName":"jamaigne","email":"[email protected]","id":"Signer1"}]},{"id":"Sender1","type":"SIGNER","signers":[{"firstName":"Haris","lastName":"Haidary","email":"[email protected]","id":"Sender1"}]}],"documents":[{"fields":[{"value":"lionel","name":"first_name"},{"value":"jamaigne","name":"last_name"},{"value":"rue du truc","name":"address"},{"value":"martelange","name":"city"},{"value":"8832","name":"zip"},{"value":"saipas","name":"state"},{"value":"belgique","name":"country"},{"value":"32499463127","name":"phone_number"},{"value":"[email protected]","name":"email"},{"value":"docunify sa","name":"company"},{"value":"44","name":"policy_number"}],"name":"Sample Contract","id":"contract","extract":true}],"name":"NodeJS Example","type":"PACKAGE","status":"DRAFT"}', file: { value: 'fs.createReadStream("C:/Users/hhaidary/Desktop/pdfs/doc1.pdf")', options: { filename: 'doc1.pdf', contentType: null } } } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });Reply to: Can't successfully retrieve package id
Friday, July 14, 2017 at 05:52amReply to: Can't successfully retrieve package id
Monday, July 17, 2017 at 01:16amReply to: Can't successfully retrieve package id
Monday, July 17, 2017 at 04:46amReply to: Can't successfully retrieve package id
Monday, July 17, 2017 at 06:37amReply to: Can't successfully retrieve package id
Monday, July 17, 2017 at 07:13am{ "documents": [ { "approvals": [ { "id": "ExampleSignatureId", "role": "Signer1", "fields": [ { "page": 0, "top": 200, "subtype": "LABEL", "height": 50, "binding": "{approval.signed}", "left": 100, "width": 200, "id": "myLabelField", "type": "INPUT", "value": "dd/mm/yyyy" }, { "page": 0, "top": 100, "subtype": "FULLNAME", "height": 50, "left": 100, "width": 200, "type": "SIGNATURE", "name": "ExampleSignatureId" } ], "name": "" } ], "id": "sample-contract", "name": "Test Document" } ], "status": "SENT", "type": "PACKAGE", "roles": [ { "id": "Signer1", "type": "SIGNER", "signers": [ { "email": "[email protected]", "firstName": "John", "lastName": "Smith", "id": "Signer1" } ], "name": "Signer1" } ], "name": "Example Package" }Reply to: Can't successfully retrieve package id
Monday, July 17, 2017 at 11:57pmReply to: Can't successfully retrieve package id
Tuesday, July 18, 2017 at 03:49amReply to: Can't successfully retrieve package id
Tuesday, July 18, 2017 at 04:51amReply to: Can't successfully retrieve package id
Tuesday, July 18, 2017 at 05:00amReply to: Can't successfully retrieve package id
Tuesday, July 18, 2017 at 05:11amhttps://sandbox.esignlive.com/access?sessionToken={signerAuthenticationToken}Reply to: Can't successfully retrieve package id
Tuesday, July 18, 2017 at 05:16amReply to: Can't successfully retrieve package id
Tuesday, July 18, 2017 at 05:37amReply to: Can't successfully retrieve package id
Tuesday, July 18, 2017 at 05:49amReply to: Can't successfully retrieve package id
Tuesday, July 18, 2017 at 06:00amReply to: Can't successfully retrieve package id
Thursday, July 20, 2017 at 03:56amReply to: Can't successfully retrieve package id
Thursday, July 20, 2017 at 05:06amReply to: Can't successfully retrieve package id
Thursday, July 20, 2017 at 08:22am{ "name": "Example Package", "data": { "senderVisible": false }, "description": "", "emailMessage": "", "autocomplete": true, "settings": { "ceremony": { "inPerson": false } }, "type": "PACKAGE", "due": null, "language": "en", "notarized": false }Reply to: Can't successfully retrieve package id
Thursday, July 20, 2017 at 08:37amvar jsonPayload = { "data": { "senderVisible": false }, "language": "", "documents": [{ "id": "sample-contract", "name": "" }], "status": "DRAFT", "type": "PACKAGE", "roles": [{ "id": "Signer1", "type": "SIGNER", "signers": [] }], "name": "Demande de signature(s)" }Right now i have an empty array but i'd like to fill it will this kind of datavar new_signer = { "email": user.email, "firstName": user.firstname, "lastName": user.lastname, "id": "Signer1", "language": user.language };and then do this. I can successfully add it in the array but since i cannot see any of it in the designer my guess is i should add it an other way.Reply to: Can't successfully retrieve package id
Thursday, July 20, 2017 at 09:00amJSON.stringify(jsonPayload)before making your request?Reply to: Can't successfully retrieve package id
Thursday, July 20, 2017 at 09:03amvar options = { method: 'POST', url: 'https://sandbox.esignlive.com/api/packages', // PROD: https://apps.esignlive.com/api headers: { accept: 'application/json; esl-api-version=11.0', authorization: 'Basic ' + api_key, 'content-type': 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' }, formData: { file: { value: document, options: { filename: fichier.filename, contentType: null } }, payload: JSON.stringify(jsonPayload) } };Reply to: Can't successfully retrieve package id
Thursday, July 20, 2017 at 09:37amvar jsonPayload = { "data": { "senderVisible": false }, "language": "", "documents": [{ "id": "sample-contract", "name": "" }], "status": "DRAFT", "type": "PACKAGE", "roles": [], "name": "Demande de signature(s)" }; var new_signer1 = { "id": "Signer1", "type": "SIGNER", "signers": [ { "email": "[email protected]", "firstName": "John", "lastName": "Smith", "id": "Signer1", "language": "en" } ] }; var new_signer2 = { "id": "Signer2", "type": "SIGNER", "signers": [ { "email": "[email protected]", "firstName": "Patty", "lastName": "Galant", "id": "Signer2", "language": "en" } ] }; jsonPayload.roles.push(new_signer1); jsonPayload.roles.push(new_signer2);Reply to: Can't successfully retrieve package id
Thursday, July 20, 2017 at 10:09am