tehpao | Posts: 17

signing through api is not working

0 votes
Hi All, Hope someone can shed some light on what i am doing wrong. In salesforce apex code I am creating package DateTime dT = System.now(); dT.addDays(7); ESignLiveExamples.createPackageWithDocumentsExample( 'Demo12', true, 'Demo12 description', dT, 'Hello World, Demo12 is READY' ); Works great no issue Then I change the status to SENT ESignLiveExamples.setStatusExample('{my package ID}', ESignLiveAPIObjects.PackageStatus.SENT); no problem here too package move from DRAFT to INBOX TIme to sign it String outboundRequestBody = ESignLiveJSONHelper.prepareOutboundJSON('{"documents": [{"id": "contractId","name": "Demo12"}]}'); System.debug('=> outboundRequestBody:'+outboundRequestBody); // Build Request HttpRequest request = new HttpRequest(); request.setEndpoint('https://sandbox.esignlive.com/api/packages/{Package ID from the top}/documents/signed_documents'); request.setBody(outboundRequestBody); request.setMethod('POST'); request.setHeader('Authorization', 'Basic ' + 'xxxxxxxxxxx'); request.setHeader('Content-type', 'application/json'); request.setHeader('Accept', 'application/json'); // Send Request HttpResponse response = (new Http()).send(request); I get response back 200 OK and when I look into esignlive INBOX document is still NOT SIGNED Any help will be appreciated. Thank you -Ted

tehpao | Posts: 17

Reply to: signing through api is not working

0 votes
Thanks I was able to resolve this by adding an document ID(which was missing so eSignlive was assigning random string) in my package and I was able to fix my issue. I will keep in mind about bulk sign as this will help me in future. Thank you. Haris.

harishaidary | Posts: 1812

Reply to: signing through api is not working

0 votes
No problem. Let me know if you have any other questions.

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