Tony | Posts: 12

Setting Up Reminders with REST

0 votes
I read the following blog post: https://www.esignlive.com/blog/esignlive-setting-reminders And tried setting up reminders in my initial POST request that creates a signing package. It's not working. ESL creates the package with no error messages but the reminders never get sent. Is this because rememinders have to be configured in a separate PUT request sent after the package has been created? Here is my full POST request: { "roles": [ { "locked": false, "emailMessage": { "content": "" }, "attachmentRequirements": [], "reassign": false, "specialTypes": [], "id": "GEORGE_H_MORLAN", "data": null, "type": "SIGNER", "index": 0, "signers": [ { "auth": { "challenges": [ { "answer": "6789", "question": "What are the last 4 digits of your SSN or TaxID?", "maskInput": false } ], "scheme": "CHALLENGE" }, "company": "", "firstName": "GEORGE", "lastName": "MORLAN", "phone": "", "email": "[email protected]", "knowledgeBasedAuthentication": null, "language": "en", "title": "", "external": null, "professionalIdentityFields": [], "userCustomFields": [], "delivery": { "email": true, "provider": false, "download": false }, "group": null, "signature": null, "address": null, "data": null, "name": "GEORGE H MORLAN", "specialTypes": [], "id": "GEORGE_H_MORLAN" } ], "name": "GEORGE H MORLAN" } ], "documents": [ { "approvals": [ { "role": "GEORGE_H_MORLAN", "signed": null, "accepted": null, "data": null, "fields": [ { "page": 0, "subtype": "FULLNAME", "width": 200, "binding": null, "extract": false, "extractAnchor": null, "left": 100, "top": 700, "validation": null, "height": 50, "data": null, "type": "SIGNATURE", "value": "" } ], "name": "Approval name" } ], "name": "Extension Agreement", "fields": [ { "name": "Next Due Date", "value": "9/21/2018" }, { "name": "Document Date", "value": "8/21/2018" }, { "name": "Borrower Name", "value": "GEORGE H MORLAN" }, { "name": "Co-Signer Name", "value": "" }, { "name": "Account Number", "value": "514671798" }, { "name": "Effective Date", "value": "9/21/2018" }, { "name": "Months Extended", "value": "1" }, { "name": "Next Payment Due", "value": "9/21/2018" }, { "name": "New Maturity Date", "value": "8/21/2030" }, { "name": "Null Void Date", "value": "8/25/2018" } ] } ], "name": "Extension", "type": "PACKAGE", "language": "en", "emailMessage": "8/25/2018", "description": "Defines the terms of the Extension agreement", "autoComplete": true, "status": "SENT", "settings": { "ceremony": { "events": null, "inPerson": false, "declineButton": false, "declineReasons": [], "disableDeclineOther": false, "disableDownloadForUncompletedPackage": false, "disableFirstInPersonAffidavit": false, "disableInPersonAffidavit": false, "disableOptOutOther": false, "disableSecondInPersonAffidavit": false, "documentToolbarOptions": null, "handOver": null, "hideCaptureText": false, "hideLanguageDropdown": false, "hidePackageOwnerInPerson": false, "hideWatermark": false, "maxAuthFailsAllowed": 0, "optOutButton": false, "optOutReasons": [], "style": null, "layout": null } }, "reminders": { "startInDaysDelay": 1, "intervalInDays": 1, "repetitionsCount": 3 }, "due": "2018-08-25" }

Duo_Liang | Posts: 3776

Reply to: Setting Up Reminders with REST

0 votes
Hi Tony, Yes, your assumption is correct. To set up reminders, you'd need to make another POST call after your package is created. Because "reminders" is not the attribute you can find in your GET /api/packages/{packageId} payload, you will need GET /api/packages/{packageId}/reminders to grab your reminder info. So you will need to : 1. create the package and leave the status to "DRAFT" 2. set up reminders by following API 3. send the package
HTTP Request
POST /api/packages/{packageId}/reminders

HTTP Headers
Accept: application/json
Content-Type: application/json
Authorization: Basic api_key

Request Payload
{
  "startInDaysDelay": 1,
  "repetitionsCount": 5,
  "intervalInDays": 1,
  "packageId": "{packageId}"
}
Hope this could help you! Duo

Tony | Posts: 12

Reply to: Setting Up Reminders with REST

0 votes
Thank you, Duo. I'm trying to refactor my code according to this and now I'm running into another problem. The document that I attach to my initial POST to create the package in DRAFT status is not being saved. When I look at the resulting draft package in the ESL site, there is no document attached. And when I try to send a POST to change the status from DRAFT to SENT, it returns: {"code":400,"message":"Cannot send package without approvals.","messageKey":"error.validation.sendPackage.noApprovals","name":"Validation Error"} Up until now, I have been setting up everything, including the .pdf document and approvals, in the first POST request that creates the package. This works fine if status=SENT in the initial request. But now that I'm having to break this into three requests (create package, set up reminders, send package), this approach is no longer working. It looks like I'm going to have to create and attach my .pdf document in step 3 that sends the package. Is this right? Are there other things that I'm currently sending in my initial POST above that will have to be moved to the 3rd step, as well?

Duo_Liang | Posts: 3776

Reply to: Setting Up Reminders with REST

0 votes
Hi Tony, I think the document shouldn't be lost after the initial POST call and you don't need to move anything to the third step. Because the only difference to your original call is the package status, everything else should keep the same behavior. So can you share your code snippet here or send to [email protected] so that I can have a closer look at the issue? Duo

Tony | Posts: 12

Reply to: Setting Up Reminders with REST

0 votes
Apparently something is wrong with my initial POST request. I switched it back to status=SENT and I get back the same response: {"code":400,"message":"Cannot send package without approvals.","messageKey":"error.validation.sendPackage.noApprovals","name":"Validation Error"} Here is my request. I don't see anything wrong with it. Do you? { "roles": [ { "locked": false, "emailMessage": { "content": "" }, "attachmentRequirements": [], "reassign": false, "specialTypes": [], "id": "BENJAMIN_J_KAPOSZTA", "data": null, "type": "SIGNER", "index": 0, "signers": [ { "auth": { "challenges": [ { "answer": "6789", "question": "What are the last 4 digits of your SSN or TaxID?", "maskInput": false } ], "scheme": "CHALLENGE" }, "company": "", "firstName": "BENJAMIN", "lastName": "KAPOSZTA", "phone": "", "email": "[email protected]", "knowledgeBasedAuthentication": null, "language": "en", "title": "", "external": null, "professionalIdentityFields": [], "userCustomFields": [], "delivery": { "email": true, "provider": false, "download": false }, "group": null, "signature": null, "address": null, "data": null, "name": "BENJAMIN J KAPOSZTA", "specialTypes": [], "id": "BENJAMIN_J_KAPOSZTA" } ], "name": "BENJAMIN J KAPOSZTA" } ], "documents": [ { "approvals": [ { "role": "BENJAMIN_J_KAPOSZTA", "signed": null, "accepted": null, "data": null, "fields": [ { "page": 0, "subtype": "FULLNAME", "width": 200, "binding": null, "extract": false, "extractAnchor": null, "left": 100, "top": 700, "validation": null, "height": 50, "data": null, "type": "SIGNATURE", "value": "" } ], "name": "Approval name" } ], "name": "Extension Agreement", "fields": [ { "name": "Next Due Date", "value": "9/28/2018" }, { "name": "Document Date", "value": "8/28/2018" }, { "name": "Borrower Name", "value": "BENJAMIN J KAPOSZTA" }, { "name": "Co-Signer Name", "value": "" }, { "name": "Account Number", "value": "514553056" }, { "name": "Effective Date", "value": "9/28/2018" }, { "name": "Months Extended", "value": "1" }, { "name": "Next Payment Due", "value": "9/28/2018" }, { "name": "New Maturity Date", "value": "8/28/2030" }, { "name": "Null Void Date", "value": "8/29/2018" } ] } ], "name": "Extension", "type": "PACKAGE", "language": "en", "emailMessage": "8/29/2018", "description": "Defines the terms of the Extension agreement", "autoComplete": true, "status": "SENT", "settings": { "ceremony": { "events": null, "inPerson": false, "declineButton": false, "declineReasons": [], "disableDeclineOther": false, "disableDownloadForUncompletedPackage": false, "disableFirstInPersonAffidavit": false, "disableInPersonAffidavit": false, "disableOptOutOther": false, "disableSecondInPersonAffidavit": false, "documentToolbarOptions": null, "handOver": null, "hideCaptureText": false, "hideLanguageDropdown": false, "hidePackageOwnerInPerson": false, "hideWatermark": false, "maxAuthFailsAllowed": 4, "optOutButton": false, "optOutReasons": [], "style": null, "layout": null } }, "due": "2018-08-29" }

Duo_Liang | Posts: 3776

Reply to: Setting Up Reminders with REST

0 votes
Hi Tony, The JSON is perfect, I've tested the JSON for you in Postman. Can you use some tools like Fiddler to monitor the request traffic going to OneSpan Sign? Duo

Tony | Posts: 12

Reply to: Setting Up Reminders with REST

0 votes
I discovered and fixed a bug I introduced earlier today while refactoring my code. I was sending a plain JSON string rather than a MultipartFormDataContent form. I fixed it and the package is being created successfully now using the three step process. It might take me a few days to confirm that the reminder emails are working. Thank you so much, Duo!

Duo_Liang | Posts: 3776

Reply to: Setting Up Reminders with REST

0 votes
You are very welcome! Glad to hear that you solved your problem, and please let us know if you have any other issues. :) Duo

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