jwaite | Posts: 2

JSON Payload Help

0 votes
Hello, I'm having a hard time structuring my JSON payload to reflect what I want to appear in my package. The documents have already been merged with *MOST* data via another source, but I do need to add some information to one of the 3 documents being sent for signing. This means I cannot build a new package with a form, but need to use the existing PDFs and structure I'm uploading to esign live. In my opinion, the easiest way would be to use a text anchor, find the location I want to add the data, and then give it a value and have esign live write it in. I would assume this is possible, since the same thing is done using signatures like this.
"approvals": [
                      {
                        "fields": [
                          {
                            "type": "SIGNATURE",
                            "extract": false,
                            "extractAnchor": {
                              "text": "(Signature of Member or Authorized Signatory)",
                              "index": 0,
                              "width": 300,
                              "height": 40,
                              "anchorPoint": "TOPLEFT",
                              "characterIndex": 0,
                              "leftOffset": 0,
                              "topOffset": -40
                            },
                            "left": 0,
                            "subtype": "FULLNAME",
                            "top": 0
                          }
                        ],
                        "role": "member"
                      }
                    ]
But I can't seem to get it to work no matter what I try, and the documentation is so confusing I can't figure out what to do next. I've tried something like this to no avail.
"fields": [
                      {
                        "name": "Principal Amount",
                        "value": "1,000,000",
                        "extractAnchor": {
                          "text": "Principal Amount",
                          "index": 0,
                          "width": 200,
                          "height": 40,
                          "anchorPoint": "TOPLEFT",
                          "characterIndex": 0,
                          "leftOffset": 0,
                          "topOffset": -40
                        },
                        "left": 0,
                        "subtype": "CUSTOMFIELD",
                        "top": 0
                      }
                    ]
I also can't seem to find the documentation that breaks down what each key should represent. I would appreciate any help someone could offer.

Approved Answer
jwaite | Posts: 2

Reply to: JSON Payload Help

1 votes
Haris, That guide doesn't really help, the text anchor positioning is pretty self explanatory. I was looking for something that went over the structure and expected input of the JSON keys like roles, id, type, index, signers, name, documents, approvals, fields, type, extract, subtype, value, binding, etc. It's hard to use the rest API because you have to search through pages and pages of different examples, as opposed to having documentation with key parameters and the inputs they take. After playing with endless combinations for hours, this is what I found to work.
    "approvals": [
                      {
                        "role": "member",
                        "fields": [
                          {
                            "type": "SIGNATURE",
                            "extract": false,
                            "extractAnchor": {
                              "text": "(Signature)",
                              "index": 0,
                              "width": 200,
                              "height": 40,
                              "anchorPoint": "TOPLEFT",
                              "characterIndex": 0,
                              "leftOffset": 0,
                              "topOffset": -40
                            },
                            "left": 0,
                            "subtype": "FULLNAME",
                            "top": 0
                          },
                          {
                            "value": "TEST INFORMATION",
                            "type": "INPUT",
                            "subtype": "LABEL",
                            "extract": false,
                            "extractAnchor": {
                              "text": "Subscriber Name:",
                              "index": 0,
                              "width": 200,
                              "height": 40,
                              "anchorPoint": "TOPLEFT",
                              "characterIndex": 0,
                              "leftOffset": 0,
                              "topOffset": -40
                            }
                          }
                        ]
                      }
                    ]

harishaidary | Posts: 1812

Reply to: JSON Payload Help

0 votes
Hi there, Have a look at this guide: https://developer.esignlive.com/guides/feature-guides/text-anchors/#rest-api. It gives you a description of each parameter and an example JSON payload. Let me know if this helps.

Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off