Embedded signing: put the ceremony in your own product
Generate a short-lived signing URL, register your allowed origins and frame the signing page in your own app.
Instead of emailing your user out to SignSpry, keep them in your own product. Ask the API for a short-lived signing URL and put it in an iframe.
Before you start
- Register your site's origin. Under API & webhooks → OAuth applications, fill in Allowed origins (for embedding), for example
https://yourapp.com(an origin is the scheme and host, with no path). Usehttps://, orhttp://localhostwhile developing; separate several with commas or new lines. - Use an API key (or token) belonging to the same SignSpry user who registered the application. Allowed origins are looked up for the user who owns the envelope.
- Send the envelope so it is out for signature. See the quickstart.
Get a URL
POST /api/v1/envelopes/{id}/recipients/{recipient_id}/embed
{ "return_url": "https://yourapp.com/signed" }
The key needs the envelopes:write scope. The response:
{ "ok": true,
"url": "https://signspry.com/sign/<token>?embed=1",
"recipient_id": "…",
"expires_at": 1787560000 }
The URL is issued with a 15-minute lifetime (expires_at, in Unix seconds) for that one recipient. Request it when the person is about to sign, not in advance. Each new URL replaces the earlier one for that recipient.
It fails with 409 if the envelope is not out for signature or that recipient has already finished.
POST …/signing-link is the plain alternative: a signing URL you can redirect to or open in a frame (add ?embed=1 for the embedded view).
Frame it
<iframe src="URL-FROM-THE-RESPONSE" width="100%" height="800"
style="border:0"></iframe>
The embedded view drops SignSpry's navigation and shows the document and signing controls. Everything else still applies: routing order, access codes, one-time codes and any other protection on the link. A signer who has to wait for others sees a waiting page.
Knowing when signing ends
SignSpry does not post messages to your page. Set a return_url, and when the signer finishes or declines, the frame goes there with the result added:
https://yourapp.com/signed?envelope=<id>&event=signed
event is signed or declined. Your page in the frame can then tell the rest of your app.
recipient.signed, envelope.completed) or by reading the envelope through the API.Testing
A test key or test application works here too and sends nothing to a real inbox. See The sandbox.