naresh_kota

REST API - JSON request format

0 votes

Hi Team,

 

Can you please help us to prepare the JSON request for below data. We are using REST API with .NET.

Please find attached document for the details.

 

Thanks,

Naresh

 


Attachments

Reply to: REST API - JSON request format

0 votes

Hi Naresh,

 

Sure thing! Just one thing to mention, for document 2 (sign for recipient1, accept for recipient2, none visibility for recipient3), it's a known limitation that it has to be either accept-only or sign for both recipient 1 and 2, but not in a mixed way. On top of that, I'd like to create the package JSON and an additional document visibility API for you.

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: REST API - JSON request format

0 votes

Hi Duo,

Thanks for sharing the information. Based on above clarification we have changed the request detail(PFA). 

It would be great if you share the JOSN request and document visibility API details.

 

Thanks,

Naresh


Attachments

Reply to:

0 votes

Hi Naresh,

 

To answer your question first, yes, it's valid for single recipient to sign on doc1 and accept on doc2.

 

And in order to create such a package, you can follow below steps:

Step1: create a DRAFT status package - note that I hardcoded the signature coordinates (page,top,left,width,height), if you use text tags or position extraction, you need to adjust the JSON accordingly


POST /api/packages

{
  "roles": [
    {
      "id": "Signer1",
      "index": 0,
      "type": "SIGNER",
      "signers": [
        {
          "email": "[email protected]",
          "firstName": "John",
          "language": "en",
          "lastName": "Smith",
          "id": "Signer1"
        }
      ],
      "name": "Signer1"
    },
    {
      "id": "Signer2",
      "index": 0,
      "type": "SIGNER",
      "signers": [
        {
          "email": "[email protected]",
          "firstName": "Mary",
          "language": "en",
          "lastName": "Smith",
          "id": "Signer2"
        }
      ],
      "name": "Signer2"
    },
    {
      "id": "Signer3",
      "index": 0,
      "type": "SIGNER",
      "signers": [
        {
          "email": "[email protected]",
          "firstName": "Aaron",
          "language": "en",
          "lastName": "Smith",
          "id": "Signer3"
        }
      ],
      "name": "Signer3"
    }
  ],
  "status": "DRAFT",
  "description": "",
  "language": "en",
  "documents": [
    {
      "id": "Document1",
      "approvals": [
        {
          "role": "Signer1",
          "id": "Document1_Signer1_Accept",
          "name": "Document1_Signer1_Accept"
        }
      ],
      "index": 1,
      "name": "Document1"
    },
    {
      "id": "Document2",
      "approvals": [
        {
          "role": "Signer1",
          "id": "Document2_Signer1_Signature1",
          "fields": [
            {
              "binding": null,
              "validation": null,
              "id": "Document2_Signer1_Signature1",
              "page": 0,
              "top": 103,
              "subtype": "FULLNAME",
              "left": 136,
              "width": 165,
              "height": 37,
              "type": "SIGNATURE",
              "value": "",
              "name": "Document2_Signer1_Signature1"
            }
          ],
          "name": "Document2_Signer1_Signature1"
        }
      ],
      "index": 2,
      "name": "Document2"
    },
    {
      "id": "Document3",
      "approvals": [
        {
          "role": "Signer1",
          "id": "Document3_Signer1_Signature1",
          "fields": [
            {
              "binding": null,
              "validation": null,
              "id": "Document3_Signer1_Signature1",
              "page": 0,
              "top": 103,
              "subtype": "FULLNAME",
              "left": 136,
              "width": 165,
              "height": 37,
              "type": "SIGNATURE",
              "value": "",
              "name": "Document3_Signer1_Signature1"
            }
          ],
          "name": "Document3_Signer1_Signature1"
        },
        {
          "role": "Signer2",
          "id": "Document3_Signer2_Signature1",
          "fields": [
            {
              "binding": null,
              "validation": null,
              "id": "Document3_Signer2_Signature1",
              "page": 0,
              "top": 303,
              "subtype": "FULLNAME",
              "left": 136,
              "width": 165,
              "height": 37,
              "type": "SIGNATURE",
              "value": "",
              "name": "Document3_Signer2_Signature1"
            }
          ],
          "name": "Document3_Signer2_Signature1"
        }
      ],
      "index": 3,
      "name": "Document3"
    }
  ],
  "autocomplete": true,
  "type": "PACKAGE",
  "name": "Example Package"
}

 

Step2: configure document visibilities

POST /api/packages/{packageId}/documents/visibility

{
  "configurations": [
    {
      "documentUid": "Document1",
      "roleUids": [
        "Signer1",
        "Signer2"
      ]
    },
    {
      "documentUid": "Document2",
      "roleUids": [
        "Signer1",
        "Signer2"
      ]
    },
    {
      "documentUid": "Document3",
      "roleUids": [
        "Signer1",
        "Signer2",
        "Signer3"
      ]
    }
  ]
}

 

Step3: Send the package

PUT /api/packages/{packageId}

{"status":"SENT"}

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


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