Skip to main content

One post tagged with "callback-urls"

View All Tags

· 4 min read

Integrating e-signatures into your app or website often means sending users off to email invites, waiting for them to find the link, complete a signature in a separate interface, then hunt their way back to your service. All those context switches kill momentum and dent your conversion rates.

In this short post, we'll explore how we can utilize callback URLs to deliver a premium and seamless signing experience directly in your app.

The Problem: Context Switches and Drop-Offs

Let’s assume you have an onboarding process where the end-user needs to sign an agreement before gaining access to your service. Here’s a typical flow without callback URLs:

  1. Sign-up completes
    User finishes registration in your app and is told to check their email.
  2. Email invite
    They leave your app, open their inbox, locate the invite, and click the link.
  3. Detached signing room
    They visit the signing room and completes signing of the document.
  4. Manual return
    After signing, they have to manually return to your service, hopefully after you’ve had time to process everything.

Every app switch and manual step adds friction. Users get distracted, forget where they were, or simply bounce. With callback URLs you can collapse those four steps into a single, in-app experience.

Getting started with Callback URLs

Let's go ahead and see how easily we can resolve this issue with callback URLs. Below is a minimal example that collapses the entire flow into a single in-app experience. We’ll:

  1. Create the agreement (with email disabled and a callback URL)
  2. Add the signer
  3. Attach the document
  4. Move the agreement to “pending”
  5. Redirect the user straight into the signing room

In this example, we presume you already have uploaded the document to be signed in the /files endpoint. If not you can learn how to do so here


1. Create the agreement

First we create the agreement. We’ll disable email communication and add a callback URL. Disabling email communication is optional and requires you to handle all communication yourself, but provides a more integrated experience.

curl -X POST https://api.zigned.se/rest/v3/agreements \
-H "Content-Type: application/json" \
-d '{
"send_emails": false,
"success_callback_url": "https://yourapp.com/zigned/callback"
}'

2. Add the signer

Next, we add the signer for the document

curl -X POST https://api.zigned.se/rest/v3/agreements/<id>/participants \
-H "Content-Type: application/json" \
-d '{
"name": "Jane Doe"
}'

3. Attach the document

Now we add the document that will be signed.

curl -X POST https://api.zigned.se/agreements/agreement_123/documents/main \
-H "Content-Type: application/json" \
-d '{
"file_id": "<YOUR_FILE_ID>"
}'

4. Initiate the signing process

Lastly, we initiate the signing process but moving the lifecycle state of the agreement to “pending”

curl -X POST https://api.zigned.se/agreements/agreement_123/lifecycle \
-H "Content-Type: application/json" \
-d '{
"lifecycle_state": { "status": "pending" }
}'

5. Redirect your user

Grab the link for the signing room from the response in the previous step. Then either present the link for the user to click on or automatically redirect them. Below is an example in javascript:

// the “res” variable represents the response from the previous step in this case

const link = res.data.participants[0].signing_room_link
window.location.href = link

Once signing is complete, Zigned will automatically send the user back to https://yourapp.com/zigned/callback, where you can finalize onboarding or trigger any follow-up logic. If you supply a unique identifier from your system in the callback-url, we will send that too in order for you to more easily handle the rest on your end.

And that’s it!

With just a few lines of code, callback URLs let you collapse fragmented signing flows into a single, in-app experience—boosting completion rates and keeping users engaged. Give it a try in your next integration, and let us know how it goes. Happy signing!