Update documents of a given template
PUT/templates/{uuid}/documents
The API endpoint provides the functionality to remove or add documents of a given template.
Parameters
- uuid String
The unique identifier of the document template.
Request Body Properties
- documents Text
Used to remove an existing document attached to a template.
List of documents you want to remove
[
{
"remove":boolean,
"uuid": string
}
]
Example :
[
{
"remove":"true",
"uuid":"4891e4d3-a66d-429d-a7db-bcc34f6fe499"
},
{
"remove":"true",
"uuid":"a11418ef-f5e4-4dcc-82f2-3189840950e2"
},
]
- file File
A template is composed of files
📘
Content-Type : multipart/form-data
📘
Files can be of type .pdf
, .png
and .jpg
NodeJS
var axios = require("axios").default;
let formData = new FormData()
formData.append('documents', '[{"remove":"true", "uuid":"42c33e69-1023-4899-af9f-688fc6e3646d"},{"remove":"true", "uuid":"a11418ef-f5e4-4dcc-82f2-3189840950e2"}]')
formData.append('file', '/Users/user/test3.pdf')
formData.append('file', '/Users/user/test4.pdf')
var options = {
method: 'POST',
url: 'https://api.signature.nc/api/v1/templates',
headers: {'Authorization': 'Bearer {apiKey}'},
body: formData
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
json
{
"documents": [
{
"name": "test3.pdf",
"uuid": "24f878ea-9bbd-4e11-b28d-4fe3fb753b2a",
"fields": [],
"url": "https://api.signature.nc/uploads/test3.pdf"
}
{
"name": "test4.pdf",
"uuid": "800f4f48-beca-4575-8810-a5211210bdc7",
"fields": [],
"url": "https://api.signature.nc/uploads/test4.pdf"
}
]
}