Flexible eSign guide
Signing config creation
The signing config is a JSON that specifies on which pages and at what coordinates the specific user has to sign. The size of the signer's rectangle.
- Signing config allows you to sign at multiple places on same page.
- Sign at multiple places on different pages.
- Sign at any coordinate on a page.
Understanding the config schema
{
"signers": [
{
"optional": false,
"signRectangles": [
{
"coordinate": {
"lowerLeftX": 402,
"lowerLeftY": 53,
"upperRightX": 542,
"upperRightY": 93
},
"pages": [0,1]
},
{
"coordinate": {
"lowerLeftX": 358,
"lowerLeftY": 232,
"upperRightX": 498.53009106595096,
"upperRightY": 272.52901734104046
},
"pages": [2]
}
]
}
]
}- The signers array specifies the config for each signer. Each signer config has information about what pages and coordinates the specific signer has to sign.
- The above example indicates there is one signer. Who should sign at
(x1:402, y1:53, x2:542, y2:93)on pages 0 and 1. Assuming starting index as 0. On coordinate(x1:358, y1:232, x2:498.53, y2:272)on page 2. - The coordinates are the lower left and upper right of the diagonal of the sign rectangle.
- The config can be used to get flexible configurations like one signer signs on multiple places on the same page with multiple signers in the overall configuration.
- The
optionalfield indicates whether the sign by that signer is required for completion of document.
Examples
Multiple signers, different pages and same coordinates
Signer 1 signs at (x1:402, y1:53, x2:542, y2:93) on pages 0 and
1.
Signers 2 signs at (x1:402, y1:53, x2:542, y2: 93) on pages 2 and
3.
{
"signers": [
{
"optional": false,
"signRectangles": [
{
"coordinate": {
"lowerLeftX": 402,
"lowerLeftY": 53,
"upperRightX": 542,
"upperRightY": 93
},
"pages": [0,1]
}
]
},
{
"optional": false,
"signRectangles": [
{
"coordinate": {
"lowerLeftX": 402,
"lowerLeftY": 53,
"upperRightX": 542,
"upperRightY": 93
},
"pages": [2,3]
}
]
}
]
}Multiple signers and one signer signs in multiple places on the same page
Signer 1 signs at (x1:402, y1:53, x2:542, y2:93) on pages 0 and
1.
Signer 1 signs at (x1:358, y1:232, x2:498, y2:272) on pages 0 and
1.
Signer 2 signs at (x1:402, y1: 53, x2: 542, y2:93) on pages 2
and 3.
{
"signers": [
{
"optional": false,
"signRectangles": [
{
"coordinate": {
"lowerLeftX": 402,
"lowerLeftY": 53,
"upperRightX": 542,
"upperRightY": 93
},
"pages": [0,1]
},
{
"coordinate": {
"lowerLeftX": 358,
"lowerLeftY": 232,
"upperRightX": 498,
"upperRightY": 272
},
"pages": [0,1]
}
]
},
{
"optional": false,
"signRectangles": [
{
"coordinate": {
"lowerLeftX": 402,
"lowerLeftY": 53,
"upperRightX": 542,
"upperRightY": 93
},
"pages": [2,3]
}
]
}
]
}Upload signing config
configId is an optional UUID parameter. If passed, the config will be created with the same ID. If not passed, a new configId will be generated automatically.
200
SUCCESS Setu has
processed your request successfully.
Request
POST /api/signature/config
{
"configId": "825169c7-08a4-4739-94d5-0d8c4ef5e4f1", // Optional
"signers": [
{
"optional": false,
"signRectangles": [
{
"coordinate": {
"lowerLeftX": 402,
"lowerLeftY": 53,
"upperRightX": 542,
"upperRightY": 93
},
"pages": [0, 1]
},
{
"coordinate": {
"lowerLeftX": 358,
"lowerLeftY": 232,
"upperRightX": 498.53009106595096,
"upperRightY": 272.52901734104046
},
"pages": [2]
}
]
}
]
}Response
You will get the following details—
Unique configId
idwhich can be used to create signature request.The same configId can be used across multiple signature request using doc of one type.
{
"configId": "825169c7-08a4-4739-94d5-0d8c4ef5e4f1",
"traceId": "5de9b52d-1252-409b-9bc5-063fa67f8191"
}Update signing config
The latest version of config will be used for signing the request, but you can view the previous versions of config using the configId.
200
SUCCESS Setu has
processed your request successfully.
Request
PUT /api/signature/config
{
"configId": "df9962aa-153e-410a-b98c-9aa351936fb3",
"config": {
"signers": [
{
"optional": false,
"signRectangles": [
{
"coordinate": {
"lowerLeftX": 358,
"lowerLeftY": 232,
"upperRightX": 498.53009106595096,
"upperRightY": 272.52901734104046
},
"pages": [
2
]
}
]
}
]
}
}Response
{
"configId": "df9962aa-153e-410a-b98c-9aa351936fb7",
"config": {
"signers": [
{
"optional": false,
"signRectangles": [
{
"coordinate": {
"lowerLeftX": 358.0,
"lowerLeftY": 232.0,
"upperRightX": 498.53009106595096,
"upperRightY": 272.52901734104046
},
"pages": [
2
]
}
]
}
]
},
"versionNo": 2,
"traceId": "1-671a2aad-7b1fd38704e5f1567083fcd3"
}"key": "2",
404
NOT FOUND The configId does not exist.
Request
PUT /api/signature/config
{
"configId": "df9962aa-153e-410a-b98c-9aa351936fb3",
"config": {
"signers": [
{
"optional": false,
"signRectangles": [
{
"coordinate": {
"lowerLeftX": 358,
"lowerLeftY": 232,
"upperRightX": 498.53009106595096,
"upperRightY": 272.52901734104046
},
"pages": [
2
]
}
]
}
]
}
}Response
{
"error": {
"code": "config_id_not_found",
"detail": "Unable to find the resource",
"traceId": "1-671a2f9f-1ffab5482d801880634082e3"
}
}"key": "3",
500
INTERNAL SERVER ERROR
Setu has failed to process your request due to some
error in code or an unreachable database.
Request
PUT /api/signature/config
{
"configId": "df9962aa-153e-410a-b98c-9aa351936fb3",
"config": {
"signers": [
{
"optional": false,
"signRectangles": [
{
"coordinate": {
"lowerLeftX": 358,
"lowerLeftY": 232,
"upperRightX": 498.53009106595096,
"upperRightY": 272.52901734104046
},
"pages": [
2
]
}
]
}
]
}
}Response
{
"error": {
"code": "unexpected_error",
"detail": "An internal server error has occurred",
"traceId": "72dbdc7b-ebcb-46f2-93b2-7a34e102ed32"
}
}Get signing config
200
SUCCESS Setu has
processed your request successfully.
If the versionNo is not provided,
the latest version of the config will be
returned by default.
Request
GET /api/signature/config/:configId/:versionNoResponse
{
"configId": "df9962aa-153e-410a-b98c-9aa351936fb7",
"config": {
"signers": [
{
"optional": false,
"signRectangles": [
{
"coordinate": {
"lowerLeftX": 358.0,
"lowerLeftY": 232.0,
"upperRightX": 498.53009106595096,
"upperRightY": 272.52901734104046
},
"pages": [
2
]
}
]
}
]
},
"versionNo": 2,
"traceId": "1-671a2aad-7b1fd38704e5f1567083fcd3"
}"key": "2",
404
NOT FOUND The configId or versionNo does not exist.
Request
GET /api/signature/config/:configId/:versionNoResponse
{
"error": {
"code": "config_id_not_found",
"detail": "Unable to find the resource",
"traceId": "1-671a2f9f-1ffab5482d801880634082e3"
}
}"key": "3",
500
INTERNAL SERVER ERROR
Setu has failed to process your request due to some
error in code or an unreachable database.
Request
GET /api/signature/config/:configId/:versionNoResponse
{
"error": {
"code": "unexpected_error",
"detail": "An internal server error has occurred",
"traceId": "72dbdc7b-ebcb-46f2-93b2-7a34e102ed32"
}
}Flow of API calls
Read more about the flow of API calls here