Let's create a document for embedded requesting on our website. You can use any document as long as it has draft
set to true
.
Templates work with embedded requesting regardless of template status. Just retrieve the
embedded_edit_url
for the template (the same way you would for a document).The
embedded_edit_url
is returned from these endpoints:
The example below is using the Create Document endpoint.
curl --location --request POST 'https://www.signwell.com/api/v1/documents/' \
--header 'X-Api-Key: [your api key]' \
--header 'Content-Type: application/json' \
--data-raw '{
"test_mode" : true,
"draft": true,
"files": [
{
"name": "Some Agreement.docx",
"file_url": "[url to your document]"
}
]
"recipients": [
{
"id": "1",
"name": "Jeremy Neeson",
"email": "[email protected]"
}
]
}'
document_response = HTTParty.post(
"https://www.signwell.com/api/v1/documents/",
headers: {
"Content-Type": "application/json",
"X-Api-Key": "[your api key]"
},
body: {
"name": "Some Agreement",
"test_mode": true, #test mode is true for testing
"draft": true,
"files": [
{
"name": "Some Agreement.docx",
"file_url": "[url to your document]"
}
],
"recipients": [
{
"id": "1",
"placeholder_name": "Contractor",
"name": "Jeremy Neeson",
"email": "[email protected]"
}
]
}.to_json
)
@embedded_edit_url = document_response['embedded_edit_url']
If you did everything right, you'll get a 200 response with your document details, including the embedded_edit_url
.
{
"id": "c4e4dbd4-4594-43b3-87b0-0b62b10b656b",
"apply_signing_order": false,
"archived": false,
"embedded_edit_url": "https://www.signwell.com/app/edit/document/e600d68a2b/"
...
"recipients" : [
{
"id": "1",
"email": "[email protected]",
"name": "Preston Olson"
}
]
}