ramkisv | Posts: 2

Rest API to draw signature

0 votes
Hi Team, Could you help me with API/JSON format to draw on a signature field . Appreciate your help. Thanks, Ramki

Duo_Liang | Posts: 3776

Reply to: Rest API to draw signature

0 votes
Hey Ramki, Did you refer to the Capture Signature type? If so, below is an example for the approval JSON node:
{
  "role": "Signer1",
  "id": "signature1",
  "fields": [
  {
    "type": "SIGNATURE",
    "subtype": "CAPTURE",
    "height": 37,
    "left": 211,
    "top": 140,
    "width": 165,
    "page": 0
  }
  ]
}
As you can see, Capture Signature is with a subtype of "CAPTURE", this is how it's different from other signature types. Hope this could help! Duo

ramkisv | Posts: 2

Reply to: Rest API to draw signature

0 votes
Hi Duo Liang, Thanks fro the reply. I had done as suggested. But system is returning below exception "{"code":400,"messageKey":"error.validation.validateApproval.noRolesOnApproval","name":"Validation Error","message":"No role specified as part of this approval.","parameters":{"approvalDataName":"signature1"}}" I am passing below data in JSON { "roles": [ { "id": "Sender1", "type": "SIGNER", "signers": [ { "firstName": "Ramki", "lastName": "SV", "email": "[email protected]", "id": "Sender1" } ] } ], "documents": [ { "fields": [ { "value": "Ramki", "name": "first_name" }, { "value": SV", "name": "last_name" }, { "value": "Abbot street", "name": "address" }, { "value": "sydney", "name": "city" }, { "value": "2120", "name": "zip" }, { "value": "NSW", "name": "state" }, { "value": "AUSTRALIA", "name": "country" }, { "value": "4101412331", "name": "phone_number" }, { "value": "[email protected]", "name": "email" }, { "value": "KRMICT", "name": "company" }, { "value": "234", "name": "policy_number" } ], "name": "Sample Contract", "id": "contract", "extract": true } ], "approvals": [ { "fields": [ { "type": "SIGNATURE", "subtype": "CAPTURE", "height": 37, "left": 211, "top": 140, "width": 165, "page": 0 } ], "role": "Signer1", "id": "signature1" } ], "name": "Sample", "type": "PACKAGE", "status": "SENT" } Could you please let me know if i am missing anything. Thanks, Ramki

Duo_Liang | Posts: 3776

Reply to: Rest API to draw signature

0 votes
Hey Ramki, I tweaked the payload a little bit for you, see below:
{
  "status": "DRAFT",
  "roles": [
    {
      "id": "Sender1",
      "type": "SIGNER",
      "signers": [
        {
          "id": "Sender1",
          "firstName": "Ramki",
          "lastName": "SV",
          "email": "[email protected]"
        }
      ]
    }
  ],
  "documents": [
    {
      "id": "contract",
      "extract": true,
      "fields": [
        {
          "value": "Ramki",
          "name": "first_name"
        },
        {
          "value": "SV",
          "name": "last_name"
        },
        {
          "value": "Abbot street",
          "name": "address"
        },
        {
          "value": "sydney",
          "name": "city"
        },
        {
          "value": "2120",
          "name": "zip"
        },
        {
          "value": "NSW",
          "name": "state"
        },
        {
          "value": "AUSTRALIA",
          "name": "country"
        },
        {
          "value": "4101412331",
          "name": "phone_number"
        },
        {
          "value": "[email protected]",
          "name": "email"
        },
        {
          "value": "KRMICT",
          "name": "company"
        },
        {
          "value": "234",
          "name": "policy_number"
        }
      ],
      "name": "Sample Contract",
      "approvals": [
        {
          "fields": [
            {
              "type": "SIGNATURE",
              "subtype": "CAPTURE",
              "height": 37,
              "left": 211,
              "top": 140,
              "width": 165,
              "page": 0
            }
          ],
          "role": "Sender1",
          "id": "signature1"
        }
      ]
    }
  ],
  "type": "PACKAGE",
  "name": "Sample"
}
Only few points to notice: 1. "role" field in "approvals" node should map with role Id, which is "Sender1" in your case. 2."approvals" node should be host under the "documents" node. Our new API Specification site is up here, for your reference. Duo

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