Create fields for a document
POST/templates/{templateuuid}/documents/{documentuuid}/fields
The API endpoint provides the functionality to create fillable fields to a document attached to a template.
Parameters
-
templateuuid String
The unique identifier of the document template. -
documentuuid String
The unique identifier of the document.
Request Body Properties
- fields Array
- name Name
The name of the fillable field - type String
Type of the fillable field :- signature
- initials
- stamp
- text
- checkbox
- date
- Area Field Area
How big and where the field is going to be placed on the document- x Integer (coords)
- y Integer (coords)
- w Integer (width)
- h Integer (height)
- page Integer (A pdf can have multiple page, default is 0)
- name Name
📘
Content-Type : application/json
📘
Files can be of type .pdf
, .png
and .jpg
NodeJS
var axios = require("axios").default;
const data = [
{
"type":"signature",
"name":"signature custom text",
"area" : {
"x":0,
"y":0,
"w":200,
"h":200,
"page":0
}
},
{
"type":"text",
"name":"signature custom text",
"area" : {
"x":100,
"y":100,
"w":200,
"h":200,
"page":0
}
},
{
"type":"stamp",
"name":"signature custom text",
"area" : {
"x":200,
"y":200,
"w":200,
"h":200,
"page":0
}
}
]
var options = {
method: 'POST',
url: 'https://api.signature.nc/api/v1/templates/24f878ea-9bbd-4e11-b28d-4fe3fb753b2a/documents/24f878ea-9bbd-4e11-b28d-4fe3fb753b2a/fields',
headers: {'Authorization': 'Bearer {apiKey}','content-type': 'application/json'},
body: data
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
json
[
{
"id": 878,
"name": "signature",
"createdAt": "2024-05-27T04:44:39.700Z",
"updatedAt": "2024-05-27T04:44:39.700Z",
"area": {
"id": 877,
"x": 0,
"y": 0,
"page": 0,
"w": 0.23756078289581367,
"h": 0.3359788306458386,
"createdAt": "2024-05-27T04:44:39.678Z",
"updatedAt": "2024-05-27T04:44:39.678Z"
}
},
{
"id": 879,
"name": "text",
"createdAt": "2024-05-27T04:44:39.789Z",
"updatedAt": "2024-05-27T04:44:39.789Z",
"area": {
"id": 878,
"x": 0.11878039144790684,
"y": 0.1679894153229193,
"page": 0,
"w": 0.23756078289581367,
"h": 0.3359788306458386,
"createdAt": "2024-05-27T04:44:39.742Z",
"updatedAt": "2024-05-27T04:44:39.742Z"
}
},
{
"id": 880,
"name": "stamp",
"createdAt": "2024-05-27T04:44:39.861Z",
"updatedAt": "2024-05-27T04:44:39.861Z",
"area": {
"id": 879,
"x": 0.23756078289581367,
"y": 0.3359788306458386,
"page": 0,
"w": 0.23756078289581367,
"h": 0.3359788306458386,
"createdAt": "2024-05-27T04:44:39.854Z",
"updatedAt": "2024-05-27T04:44:39.854Z"
}
}
]