Quick start
We suggest you read through the step by step integration guide to understand the integration in detail. Please see below for example code snippets and a postman example.
Before you start
Request your API keys, please let us know if you want to use sandbox or production.
Example code
Below is an example of the full request for creating an envelope.
x
{
"name": "envelope name",
"emails": {
"invitation": {
"body": {
"message": "Please sign this document"
}
}
},
"recipients": [
{
"name": "User 1",
"email": "user1@test.com",
"role": "CEO",
"auth_type": "no-auth",
"sign_group": 1,
"tags": [
{
"page_number": 1,
"x": 0.1,
"y": 0.1,
"type": "signature",
"optional": false,
"file_name": "myfile.pdf"
}
]
},
{
"name": "User 2",
"email": "user2@test.com",
"role": "CPO",
"auth_type": "sign-auth",
"yoti_attributes": ["full_name"],
"sign_group": 2,
"tags": [
{
"page_number": 1,
"x": 0.6,
"y": 0.3,
"type": "signature",
"optional": false,
"file_name": "myfile.pdf"
}
]
}
],
"notifications": {
"destination": "https://mysite.example/events",
"subscriptions": [
"envelope_completion"
]
}
}
const rp = require("request-promise");
const fs = require("fs");
const options = {}; //options object
const createEnvelope = () => {
const request = {
method: "POST",
uri: `<BASE_URL>/v2/envelopes`,
formData: {
file: fs.createReadStream("path/to.pdf"),
options: JSON.stringify(options),
},
headers: {
authorization: "Bearer <API_KEY>",
},
};
return rp(request)
.then((body) => body)
.catch((err) => err);
};
//send request
let result = await createEnvelope();
Web Examples
If you wanna just dive in to hacking this together, click below to see the examples. Otherwise continue with our step by step guide:
Postman
Was this page helpful?