Javascript Event Listener

If you display the actionURL over your web app (<iframe>), Tap&Sign can send a message to your Javascript through Javascript Event Listener when a recipient performs an action.

First, you need to set callbackEvent while creating the envelope:

POST/public/v1/envelopes

{
    //...
    "callbackEvent": "myCustomEvent",
    //...
}

Here is an example code that you can leverage for your own frontend (Javascript etc) code:

window.addEventListener("message", function (event) {
  //Let's assume that you set "callbackEvent" as "myCustomEvent"
  if (event.data && event.data.type === "myCustomEvent") {
    event.data.data: "xyzz" //The value of "callbackData" you sent via API
    event.data.envelope: {id: "0000-000-000", ...} //Details of envelope object
    event.data.type: "closeIFrame" // The value of callbackEvent you sent via API
    event.data.message: "ENVELOPE_SENT" // "ENVELOPE_SENT" or "RECIPIENT_VIEWED" or "RECIPIENT_SIGNED" or "ENVELOPE_COMPLETED" or "ENVELOPE_REJECTED" or "ENVELOPE_DELETED"
  }
});

Last updated