Ryan_Coleman

Updating Field Info Deletes Field

0 votes
Guys, I am trying to update a field and I am using this as a guide. https://developer.esignlive.com/guides/feature-guides/fields/ I am doing a PUT to the api call below and when it runs, it deletes the field all together. https://sandbox.esignlive.com/api/packages/{packageId}/documents/{documentId}/approvals/{signatureId}/fields/{fieldId} Also, can I get some clarification on what is needed for the signatureId? Is that the signerId associated with the role of the approval?

Approved Answer

Reply to: Updating Field Info Deletes Field

0 votes
Hey Ryan, SignatureId is also called Approval Id, which is the id attribute of approval node in JSON, take a real example:
GET /api/packages/G0w40qg3-ZteJT6PVOitWNswLCE=/documents/4ebaf1ccee87c8864063556e0c895d15bb28fe282ce2373d/approvals/xkrvYKEeks0K/
Response:
{
    "id": "xkrvYKEeks0K",
    "role": "9c085904-0d2d-4d90-a2a6-e08462716de5",
    "data": null,
    "optional": false,
    "accepted": null,
    "signed": null,
    "enforceCaptureSignature": false,
    "fields": [
        {
            "binding": "{signer.title}",
            "validation": null,
            "id": "hJl9BiBSR5Y9",
            "page": 0,
            "subtype": "LABEL",
            "data": null,
            "top": 263,
            "formattedValue": "",
            "extractAnchor": null,
            "extract": false,
            "width": 165,
            "height": 37,
            "left": 315,
            "type": "INPUT",
            "value": "{signer.title}",
            "name": ""
        },
        {
            "binding": null,
            "validation": {
                "required": false,
                "maxLength": null,
                "errorMessage": "",
                "enum": null,
                "minLength": null,
                "errorCode": null,
                "pattern": ""
            },
            "id": "7DQSOCXiqaUQ",
            "page": 0,
            "subtype": "TEXTFIELD",
            "data": null,
            "top": 310,
            "formattedValue": "",
            "extractAnchor": null,
            "extract": false,
            "width": 165,
            "height": 37,
            "left": 315,
            "type": "INPUT",
            "value": null,
            "name": ""
        },
        {
            "binding": null,
            "validation": {
                "required": false,
                "maxLength": null,
                "errorMessage": "",
                "enum": null,
                "minLength": null,
                "errorCode": null,
                "pattern": ""
            },
            "id": "i05s0eVAtFA4",
            "page": 0,
            "subtype": "TEXTAREA",
            "data": null,
            "top": 357,
            "formattedValue": "",
            "extractAnchor": null,
            "extract": false,
            "width": 165,
            "height": 37,
            "left": 315,
            "type": "INPUT",
            "value": null,
            "name": ""
        },
        {
            "binding": null,
            "validation": null,
            "id": "ZDygBreGX3sV",
            "page": 0,
            "subtype": "FULLNAME",
            "data": null,
            "top": 216,
            "formattedValue": "",
            "extractAnchor": null,
            "extract": false,
            "width": 165,
            "height": 37,
            "left": 315,
            "type": "SIGNATURE",
            "value": "",
            "name": ""
        }
    ],
    "name": ""
}
So "xkrvYKEeks0K" is the signature id and "7DQSOCXiqaUQ" is an id for a textfield. If you call a PUT method to update the field:
PUT /api/packages/G0w40qg3-ZteJT6PVOitWNswLCE=/documents/4ebaf1ccee87c8864063556e0c895d15bb28fe282ce2373d/approvals/xkrvYKEeks0K/fields/7DQSOCXiqaUQ
with payload:
{
    "binding": null,
    "validation": {
        "required": false,
        "maxLength": null,
        "errorMessage": "",
        "enum": null,
        "minLength": null,
        "errorCode": null,
        "pattern": ""
    },
    "id": "7DQSOCXiqaUQ",
    "page": 0,
    "extractAnchor": null,
    "formattedValue": "",
    "data": null,
    "top": 310,
    "subtype": "TEXTFIELD",
    "extract": false,
    "width": 165,
    "height": 37,
    "left": 315,
    "type": "INPUT",
    "value": "preset value",
    "name": ""
}
This text field will be updated and a default value will be set. Hope this could help! Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Updating Field Info Deletes Field

0 votes
Duo - That did help, thank you. My issue was that I was using the signerId and not the approvalId. Once I switched those out, it worked. Thanks!

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