Edit an eSignature draft
curl --request PUT \
--url https://core-api.getaptly.com/api/esignature/drafts/{draftId} \
--header 'Content-Type: application/json' \
--header 'x-token: <api-key>' \
--data '
{
"cardId": "<string>",
"templateIds": [
"<string>"
],
"recipients": [
{
"email": "[email protected]",
"name": "<string>",
"role": "<string>",
"slot": "<string>",
"order": 123,
"uuid": "<string>",
"_id": "<string>"
}
],
"from": "<string>",
"expirationDate": "2023-11-07T05:31:56Z",
"title": "<string>",
"userId": "<string>",
"message": "<string>",
"orderEnabled": true,
"accessType": "<string>",
"userIds": [
"<string>"
],
"assignee": "<string>",
"folderId": "<string>",
"revisionOf": "<string>",
"leaseDetails": "<unknown>"
}
'import requests
url = "https://core-api.getaptly.com/api/esignature/drafts/{draftId}"
payload = {
"cardId": "<string>",
"templateIds": ["<string>"],
"recipients": [
{
"email": "[email protected]",
"name": "<string>",
"role": "<string>",
"slot": "<string>",
"order": 123,
"uuid": "<string>",
"_id": "<string>"
}
],
"from": "<string>",
"expirationDate": "2023-11-07T05:31:56Z",
"title": "<string>",
"userId": "<string>",
"message": "<string>",
"orderEnabled": True,
"accessType": "<string>",
"userIds": ["<string>"],
"assignee": "<string>",
"folderId": "<string>",
"revisionOf": "<string>",
"leaseDetails": "<unknown>"
}
headers = {
"x-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cardId: '<string>',
templateIds: ['<string>'],
recipients: [
{
email: '[email protected]',
name: '<string>',
role: '<string>',
slot: '<string>',
order: 123,
uuid: '<string>',
_id: '<string>'
}
],
from: '<string>',
expirationDate: '2023-11-07T05:31:56Z',
title: '<string>',
userId: '<string>',
message: '<string>',
orderEnabled: true,
accessType: '<string>',
userIds: ['<string>'],
assignee: '<string>',
folderId: '<string>',
revisionOf: '<string>',
leaseDetails: '<unknown>'
})
};
fetch('https://core-api.getaptly.com/api/esignature/drafts/{draftId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://core-api.getaptly.com/api/esignature/drafts/{draftId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'cardId' => '<string>',
'templateIds' => [
'<string>'
],
'recipients' => [
[
'email' => '[email protected]',
'name' => '<string>',
'role' => '<string>',
'slot' => '<string>',
'order' => 123,
'uuid' => '<string>',
'_id' => '<string>'
]
],
'from' => '<string>',
'expirationDate' => '2023-11-07T05:31:56Z',
'title' => '<string>',
'userId' => '<string>',
'message' => '<string>',
'orderEnabled' => true,
'accessType' => '<string>',
'userIds' => [
'<string>'
],
'assignee' => '<string>',
'folderId' => '<string>',
'revisionOf' => '<string>',
'leaseDetails' => '<unknown>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://core-api.getaptly.com/api/esignature/drafts/{draftId}"
payload := strings.NewReader("{\n \"cardId\": \"<string>\",\n \"templateIds\": [\n \"<string>\"\n ],\n \"recipients\": [\n {\n \"email\": \"[email protected]\",\n \"name\": \"<string>\",\n \"role\": \"<string>\",\n \"slot\": \"<string>\",\n \"order\": 123,\n \"uuid\": \"<string>\",\n \"_id\": \"<string>\"\n }\n ],\n \"from\": \"<string>\",\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"title\": \"<string>\",\n \"userId\": \"<string>\",\n \"message\": \"<string>\",\n \"orderEnabled\": true,\n \"accessType\": \"<string>\",\n \"userIds\": [\n \"<string>\"\n ],\n \"assignee\": \"<string>\",\n \"folderId\": \"<string>\",\n \"revisionOf\": \"<string>\",\n \"leaseDetails\": \"<unknown>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://core-api.getaptly.com/api/esignature/drafts/{draftId}")
.header("x-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cardId\": \"<string>\",\n \"templateIds\": [\n \"<string>\"\n ],\n \"recipients\": [\n {\n \"email\": \"[email protected]\",\n \"name\": \"<string>\",\n \"role\": \"<string>\",\n \"slot\": \"<string>\",\n \"order\": 123,\n \"uuid\": \"<string>\",\n \"_id\": \"<string>\"\n }\n ],\n \"from\": \"<string>\",\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"title\": \"<string>\",\n \"userId\": \"<string>\",\n \"message\": \"<string>\",\n \"orderEnabled\": true,\n \"accessType\": \"<string>\",\n \"userIds\": [\n \"<string>\"\n ],\n \"assignee\": \"<string>\",\n \"folderId\": \"<string>\",\n \"revisionOf\": \"<string>\",\n \"leaseDetails\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core-api.getaptly.com/api/esignature/drafts/{draftId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cardId\": \"<string>\",\n \"templateIds\": [\n \"<string>\"\n ],\n \"recipients\": [\n {\n \"email\": \"[email protected]\",\n \"name\": \"<string>\",\n \"role\": \"<string>\",\n \"slot\": \"<string>\",\n \"order\": 123,\n \"uuid\": \"<string>\",\n \"_id\": \"<string>\"\n }\n ],\n \"from\": \"<string>\",\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"title\": \"<string>\",\n \"userId\": \"<string>\",\n \"message\": \"<string>\",\n \"orderEnabled\": true,\n \"accessType\": \"<string>\",\n \"userIds\": [\n \"<string>\"\n ],\n \"assignee\": \"<string>\",\n \"folderId\": \"<string>\",\n \"revisionOf\": \"<string>\",\n \"leaseDetails\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"_id": "<string>",
"title": "<string>",
"userId": "<string>",
"objectId": "<string>",
"aptletOriginUuid": "<string>",
"status": "<string>",
"reviewerId": "<string>",
"reviewOutcome": "approved",
"data": {
"values": {
"cardId": "<string>",
"title": "<string>",
"builder": "pdf",
"pages": [
{
"uuid": "<string>",
"renderVersion": 2,
"source": "pdf",
"widthPt": 1,
"heightPt": 1,
"blocks": [
{
"uuid": "<string>",
"type": "input",
"x": 1,
"y": 1,
"w": 1,
"h": 1,
"z": 123,
"ownerUuid": "<string>",
"required": true,
"style": {}
}
],
"url": "<string>",
"documentUuid": "<string>",
"loose": true
}
],
"recipients": [
{
"email": "[email protected]",
"name": "<string>",
"role": "<string>",
"slot": "<string>",
"order": 123,
"uuid": "<string>",
"_id": "<string>"
}
],
"from": "<string>",
"expirationDate": "2023-11-07T05:31:56Z",
"orderEnabled": true,
"accessType": "<string>",
"message": "<string>",
"templateIds": [
"<string>"
],
"documents": [
{
"uuid": "<string>",
"source": "template",
"templateId": "<string>",
"name": "<string>",
"picked": true
}
],
"userIds": [
"<string>"
],
"assignee": "<string>",
"folderId": "<string>",
"revisionOf": "<string>",
"leaseDetails": "<unknown>",
"builderVersion": 123,
"documentSettings": {
"pageSize": "letter",
"orientation": "portrait",
"margins": {
"top": 360,
"right": 360,
"bottom": 360,
"left": 360
},
"pageNumbers": {
"enabled": true,
"position": "bottom-center",
"format": "n",
"startAt": 50000,
"skipFirst": true,
"fontFamily": "<string>",
"fontSize": 1
}
}
},
"step": 123
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}eSignature
Edit an eSignature draft
Replaces the draft’s fields with the body (not a merge: send every
field the draft should keep). The draft’s pages and documents, with
any changes made in the app, are kept while cardId and templateIds
stay the same; changing either rebuilds them from the templates. The
recipients are bound to the signer slots again. A draft in review goes
back to draft. The draft keeps its creator.
PUT
/
api
/
esignature
/
drafts
/
{draftId}
Edit an eSignature draft
curl --request PUT \
--url https://core-api.getaptly.com/api/esignature/drafts/{draftId} \
--header 'Content-Type: application/json' \
--header 'x-token: <api-key>' \
--data '
{
"cardId": "<string>",
"templateIds": [
"<string>"
],
"recipients": [
{
"email": "[email protected]",
"name": "<string>",
"role": "<string>",
"slot": "<string>",
"order": 123,
"uuid": "<string>",
"_id": "<string>"
}
],
"from": "<string>",
"expirationDate": "2023-11-07T05:31:56Z",
"title": "<string>",
"userId": "<string>",
"message": "<string>",
"orderEnabled": true,
"accessType": "<string>",
"userIds": [
"<string>"
],
"assignee": "<string>",
"folderId": "<string>",
"revisionOf": "<string>",
"leaseDetails": "<unknown>"
}
'import requests
url = "https://core-api.getaptly.com/api/esignature/drafts/{draftId}"
payload = {
"cardId": "<string>",
"templateIds": ["<string>"],
"recipients": [
{
"email": "[email protected]",
"name": "<string>",
"role": "<string>",
"slot": "<string>",
"order": 123,
"uuid": "<string>",
"_id": "<string>"
}
],
"from": "<string>",
"expirationDate": "2023-11-07T05:31:56Z",
"title": "<string>",
"userId": "<string>",
"message": "<string>",
"orderEnabled": True,
"accessType": "<string>",
"userIds": ["<string>"],
"assignee": "<string>",
"folderId": "<string>",
"revisionOf": "<string>",
"leaseDetails": "<unknown>"
}
headers = {
"x-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cardId: '<string>',
templateIds: ['<string>'],
recipients: [
{
email: '[email protected]',
name: '<string>',
role: '<string>',
slot: '<string>',
order: 123,
uuid: '<string>',
_id: '<string>'
}
],
from: '<string>',
expirationDate: '2023-11-07T05:31:56Z',
title: '<string>',
userId: '<string>',
message: '<string>',
orderEnabled: true,
accessType: '<string>',
userIds: ['<string>'],
assignee: '<string>',
folderId: '<string>',
revisionOf: '<string>',
leaseDetails: '<unknown>'
})
};
fetch('https://core-api.getaptly.com/api/esignature/drafts/{draftId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://core-api.getaptly.com/api/esignature/drafts/{draftId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'cardId' => '<string>',
'templateIds' => [
'<string>'
],
'recipients' => [
[
'email' => '[email protected]',
'name' => '<string>',
'role' => '<string>',
'slot' => '<string>',
'order' => 123,
'uuid' => '<string>',
'_id' => '<string>'
]
],
'from' => '<string>',
'expirationDate' => '2023-11-07T05:31:56Z',
'title' => '<string>',
'userId' => '<string>',
'message' => '<string>',
'orderEnabled' => true,
'accessType' => '<string>',
'userIds' => [
'<string>'
],
'assignee' => '<string>',
'folderId' => '<string>',
'revisionOf' => '<string>',
'leaseDetails' => '<unknown>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://core-api.getaptly.com/api/esignature/drafts/{draftId}"
payload := strings.NewReader("{\n \"cardId\": \"<string>\",\n \"templateIds\": [\n \"<string>\"\n ],\n \"recipients\": [\n {\n \"email\": \"[email protected]\",\n \"name\": \"<string>\",\n \"role\": \"<string>\",\n \"slot\": \"<string>\",\n \"order\": 123,\n \"uuid\": \"<string>\",\n \"_id\": \"<string>\"\n }\n ],\n \"from\": \"<string>\",\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"title\": \"<string>\",\n \"userId\": \"<string>\",\n \"message\": \"<string>\",\n \"orderEnabled\": true,\n \"accessType\": \"<string>\",\n \"userIds\": [\n \"<string>\"\n ],\n \"assignee\": \"<string>\",\n \"folderId\": \"<string>\",\n \"revisionOf\": \"<string>\",\n \"leaseDetails\": \"<unknown>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://core-api.getaptly.com/api/esignature/drafts/{draftId}")
.header("x-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cardId\": \"<string>\",\n \"templateIds\": [\n \"<string>\"\n ],\n \"recipients\": [\n {\n \"email\": \"[email protected]\",\n \"name\": \"<string>\",\n \"role\": \"<string>\",\n \"slot\": \"<string>\",\n \"order\": 123,\n \"uuid\": \"<string>\",\n \"_id\": \"<string>\"\n }\n ],\n \"from\": \"<string>\",\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"title\": \"<string>\",\n \"userId\": \"<string>\",\n \"message\": \"<string>\",\n \"orderEnabled\": true,\n \"accessType\": \"<string>\",\n \"userIds\": [\n \"<string>\"\n ],\n \"assignee\": \"<string>\",\n \"folderId\": \"<string>\",\n \"revisionOf\": \"<string>\",\n \"leaseDetails\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core-api.getaptly.com/api/esignature/drafts/{draftId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cardId\": \"<string>\",\n \"templateIds\": [\n \"<string>\"\n ],\n \"recipients\": [\n {\n \"email\": \"[email protected]\",\n \"name\": \"<string>\",\n \"role\": \"<string>\",\n \"slot\": \"<string>\",\n \"order\": 123,\n \"uuid\": \"<string>\",\n \"_id\": \"<string>\"\n }\n ],\n \"from\": \"<string>\",\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"title\": \"<string>\",\n \"userId\": \"<string>\",\n \"message\": \"<string>\",\n \"orderEnabled\": true,\n \"accessType\": \"<string>\",\n \"userIds\": [\n \"<string>\"\n ],\n \"assignee\": \"<string>\",\n \"folderId\": \"<string>\",\n \"revisionOf\": \"<string>\",\n \"leaseDetails\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"_id": "<string>",
"title": "<string>",
"userId": "<string>",
"objectId": "<string>",
"aptletOriginUuid": "<string>",
"status": "<string>",
"reviewerId": "<string>",
"reviewOutcome": "approved",
"data": {
"values": {
"cardId": "<string>",
"title": "<string>",
"builder": "pdf",
"pages": [
{
"uuid": "<string>",
"renderVersion": 2,
"source": "pdf",
"widthPt": 1,
"heightPt": 1,
"blocks": [
{
"uuid": "<string>",
"type": "input",
"x": 1,
"y": 1,
"w": 1,
"h": 1,
"z": 123,
"ownerUuid": "<string>",
"required": true,
"style": {}
}
],
"url": "<string>",
"documentUuid": "<string>",
"loose": true
}
],
"recipients": [
{
"email": "[email protected]",
"name": "<string>",
"role": "<string>",
"slot": "<string>",
"order": 123,
"uuid": "<string>",
"_id": "<string>"
}
],
"from": "<string>",
"expirationDate": "2023-11-07T05:31:56Z",
"orderEnabled": true,
"accessType": "<string>",
"message": "<string>",
"templateIds": [
"<string>"
],
"documents": [
{
"uuid": "<string>",
"source": "template",
"templateId": "<string>",
"name": "<string>",
"picked": true
}
],
"userIds": [
"<string>"
],
"assignee": "<string>",
"folderId": "<string>",
"revisionOf": "<string>",
"leaseDetails": "<unknown>",
"builderVersion": 123,
"documentSettings": {
"pageSize": "letter",
"orientation": "portrait",
"margins": {
"top": 360,
"right": 360,
"bottom": 360,
"left": 360
},
"pageNumbers": {
"enabled": true,
"position": "bottom-center",
"format": "n",
"startAt": 50000,
"skipFirst": true,
"fontFamily": "<string>",
"fontSize": 1
}
}
},
"step": 123
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}Body
application/json
Body of draft create and edit. Pages, package documents and page settings are built from templateIds, not sent. Unlisted fields are dropped.