Tried Text Anchors but getting Error 400
Monday, July 3, 2023 at 05:44amI'm trying to place signature using the text anchors in Payload in API Body by referring the blog(OneSpan Sign How To: Using Text Anchors | OneSpan), but I'm getting the below validation error (Currently testign this in Postman), Also attaching the Document that has to be uploaded.
Error
{
"messageKey": "error.validation.validateApproval.noRolesOnApproval",
"parameters": {
"approvalDataName": "nloPAFsepjEO"
},
"message": "No role specified as part of this approval.",
"code": 400,
"name": "Validation Error"
}
The Payload i used
{
"roles": [
{
"id": "Recipient",
"type": "SIGNER",
"index": 1,
"signers": [
{
"firstName": "John",
"lastName": "Smith",
"email": "[email protected]"
}
],
"name": "Recipient"
},
{
"id": "client",
"type": "SIGNER",
"index": 2,
"signers": [
{
"firstName": "Bob",
"lastName": "Murray",
"email": "[email protected]"
}
],
"name": "client"
}
],
"documents": [
{
"approvals": [
{
"fields": [
{
"type": "SIGNATURE",
"extract": false,
"extractAnchor": {
"text": "Signature of the Client",
"index": 0,
"width": 150,
"height": 40,
"anchorPoint": "TOPLEFT",
"characterIndex": 0,
"leftOffset": 0,
"topOffset": -50
},
"left": 0,
"subtype": "FULLNAME",
"top": 0
},
{
"value": null,
"type": "INPUT",
"binding": "{signer.name}",
"extract": false,
"extractAnchor": {
"text": "(hereafter referred to as",
"index": 0,
"width": 150,
"height": 20,
"anchorPoint": "TOPRIGHT",
"characterIndex": 0,
"leftOffset": -175,
"topOffset": -5
},
"left": 0,
"subtype": "LABEL",
"top": 0
},
{
"value": null,
"type": "INPUT",
"binding": "{approval.signed}",
"extract": false,
"extractAnchor": {
"text": "Date",
"index": 0,
"width": 75,
"height": 40,
"anchorPoint": "TOPRIGHT",
"characterIndex": 4,
"leftOffset": 10,
"topOffset": -30
},
"left": 0,
"subtype": "LABEL",
"top": 0
}
],
"role": "client"
},
{
"fields": [
{
"type": "SIGNATURE",
"extract": false,
"extractAnchor": {
"text": "Signature of the Contractor",
"index": 0,
"width": 150,
"height": 40,
"anchorPoint": "TOPLEFT",
"characterIndex": 0,
"leftOffset": 0,
"topOffset": -50
},
"left": 0,
"subtype": "FULLNAME",
"top": 0
},
{
"value": null,
"type": "INPUT",
"binding": "{signer.name}",
"extract": false,
"extractAnchor": {
"text": "(hereafter referred to as",
"index": 1,
"width": 150,
"height": 20,
"anchorPoint": "TOPRIGHT",
"characterIndex": 0,
"leftOffset": -175,
"topOffset": -5
},
"left": 0,
"subtype": "LABEL",
"top": 0
},
{
"value": null,
"type": "INPUT",
"binding": "{approval.signed}",
"extract": false,
"extractAnchor": {
"text": "Date",
"index": 1,
"width": 75,
"height": 40,
"anchorPoint": "TOPRIGHT",
"characterIndex": 4,
"leftOffset": 10,
"topOffset": -30
},
"left": 0,
"subtype": "LABEL",
"top": 0
}
],
"role": "contractor"
}
],
"name": "Sample Contract"
}
],
"name": "Text Anchor Extraction Example REST API",
"type": "PACKAGE",
"language": "en",
"autoComplete": true,
"status": "DRAFT"
}
Reply to: Tried Text Anchors but getting Error 400
Wednesday, July 5, 2023 at 07:32am(1)To check the status of a transaction, it's more suggested to set up a callback listener and monitor the PACKAGE_COMPLETE event.
Otherwise, you can retrieve the transaction status via this API:
GET /api/packages/{packageId}/signingStatus
(2)You can download the signed documents and evidence summary via these two APIs:
GET /api/packages/{packageId}/documents/zip
GET /api/packages/{packageId}/evidence/summary
Duo
Reply to: Tried Text Anchors but getting Error 400
Monday, July 3, 2023 at 09:53amHi Yogeshgyw,
Please try the JSON I replied in your other post. :)
Duo
Reply to: Tried Text Anchors but getting Error 400
Monday, July 3, 2023 at 08:53pmas you suggested it worked thanks. currently the document is falling into drafts, instead how to trigger the approval process?
Reply to: Tried Text Anchors but getting Error 400
Tuesday, July 4, 2023 at 08:27amHi Yogeshgyw,
If you set status as SENT in your JSON, the transaction will be sent out directly. Alternatively, you can create the transaction in DRAFT status first, then make a PUT call to update the status:
PUT /api/packages/{packageId}
{"status": "SENT"}
Duo
Reply to: Tried Text Anchors but getting Error 400
Tuesday, July 4, 2023 at 09:00pmThanks a lot Duo_Liang
Apparently could you be able to offer some assistance with the APIs used to check the status of the Document and download the fully signed/completed Document.
Reply to: Tried Text Anchors but getting Error 400
Wednesday, July 5, 2023 at 07:35amThanks Duo_Liang
Reply to: Tried Text Anchors but getting Error 400
Wednesday, July 5, 2023 at 08:42amThanks Duo_Liang