Adding Anchor tags to a document
Sunday, October 25, 2015 at 10:46amI have been hitting a bit of a brick wall trying to add text anchor tags to an uploaded document.
Let my explain what I have been attempting to achieve.
First I upload a document to an existing package, the package already contains a new role that I have created. Both the package and the role are created though the sandbox web interface just to bootstrap the environment.
I then progmatically upload a document with the following details for example
I POST a multipart request to https://sandbox.esignlive.com/api/packages/f7d04bb5-f9df-4d7a-95d7-50f84a7ebb4f/documents.
note: I would swap the :id to what ever new package I had created to work with.
This uploads find a returns a successful response like following:
{
"status": "",
"description": "",
"approvals": [],
"pages": [
{
"top": 0.0,
"height": 1030.0,
"left": 0.0,
"width": 796.0,
"id": "2bbb4929f5561c75_1.png",
"index": 0,
"version": 462978
}
],
"external": nil,
"extract": false,
"id": "a8eeb13740979ff9",
"data": nil,
"index": 1,
"fields": [],
"name": "test_form",
"size": 6466
}
I then perform a GET request just to confirm to document is there. I know this step is not really needed, but I'm just trying to break it down while I'm trying to debug.
I take the name and index from the response and use them to create the following request payload for a PUT request
{
"name": "test_form",
"index": 1,
"approvals": [
{
"fields": [
{
"type": "SIGNATURE",
"width": 200,
"height": 50,
"page": 0,
"extract": false,
"extractAnchor": {
"text": "Nondisclosure",
"index": 0,
"width": 150,
"height": 40,
"anchorPoint": "BOTTOMRIGHT",
"characterIndex": 9,
"leftOffset": 0,
"topOffset": 0
},
"left": 0,
"subtype": "FULLNAME",
"top": 0
}
],
"role": "Signer1"
}
],
"extract": true
}
This would give me the following response.
{
"packageId": nil,
"messageKey": "error.validation.packageManagement.invalidDocument",
"technical": "Document: c320a4f84cc9c938 was not found for Process with Guid: f7d04bb5-f9df-4d7a-95d7-50f84a7ebb4f",
"entity": nil,
"code": 404,
"message": "Can not find specified document.",
"name": "Resource Not Found"
}
If I remove the index key from the original PUT request, I get a successful response, but the role isn't assigned and sandbox web UI for that pack will crash with and error in the console about a missing role. I can get the package to load in the web UI again if I make a DELETE request to the api and remove the affected document.
I'm at a bit of a loss as where to go from here.
Reply to: Adding Anchor tags to a document
Monday, October 26, 2015 at 01:50pmReply to: Adding Anchor tags to a document
Monday, October 26, 2015 at 03:01pm