Ryan_Coleman

Bare Minimum fields required for new Package upload?

0 votes
So the documentation on the site doesn't really help with this issue. I'm in the process of creating the JSON object used for the package and was wondering if anyone knows what the bare minimum fields are that are required for creating and sending a new package up? The creating and sending example is good, but has a lot of fields that it says are not required.

Approved Answer

Reply to: Bare Minimum fields required for new Package upload?

0 votes
Ryan, In speaking with Doug (the SE you have been working with), what Duo has posted is basically the minimum that you would need to provide. There are a couple in there that aren't necessary either, like the "type" and some of the "id" properties. "PACKAGE" and "SIGNER" types are defaults, I believe, and any "id", if not defined by you in the payload, is automatically generated by OneSpan Sign. The only "id" you will need to define will be the Role ID because you're manually assigning field/approval locations (per Doug). So, your actual minimum could be as small as this (for 2 signers, 1 document, and 1 signature per signer):
{
  "documents": [
    {
      "approvals": [
        {
          "role": "Role1",
          "fields": [
            {
              "page": 0,
              "top": 100,
              "subtype": "FULLNAME",
              "height": 50,
              "left": 100,
              "width": 200,
              "type": "SIGNATURE"
            }
          ]
        },
        {
          "role": "Role2",
          "fields": [
            {
              "page": 0,
              "top": 300,
              "subtype": "FULLNAME",
              "height": 50,
              "left": 100,
              "width": 200,
              "type": "SIGNATURE"
            }
          ]
        }
      ],
      "name": "Test Document"
    }
  ],
  "status": "SENT",
  "roles": [
    {
      "id": "Role1",
      "signers": [
        {
          "email": "[email protected]",
          "firstName": "1.firstname",
          "lastName": "1.lastname"
        }
      ]
    },
    {
      "id": "Role2",
      "signers": [
        {
          "email": "[email protected]",
          "firstName": "2.firstname",
          "lastName": "2.lastname"
        }
      ]
    }
  ],
  "name": "Example Package"
}

- Michael Partner and Developer Technologies Manager, OneSpan Facebook - Twitter - LinkedIn


Reply to: Bare Minimum fields required for new Package upload?

1 votes
Hi Ryan, The following is a sample request payload to create a package with one document and two signers.(Two signature approvals for two people) I don't think it's contains the minimum fields, but definitely with fields you would frequently use.
{
   "documents":[
      {
         "approvals":[
            {
               "id":"Signature1",
               "role":"Role1",
               "fields":[
                  {
                     "page":0,
                     "top":100,
                     "subtype":"FULLNAME",
                     "height":50,
                     "left":100,
                     "width":200,
                     "type":"SIGNATURE",
                     "name":"ExampleSignatureId"
                  }
               ],
               "name":""
            },
            {
               "id":"Signature2",
               "role":"Role2",
               "fields":[
                  {
                     "page":0,
                     "top":300,
                     "subtype":"FULLNAME",
                     "height":50,
                     "left":100,
                     "width":200,
                     "type":"SIGNATURE",
                     "name":"ExampleSignatureId"
                  }
               ],
               "name":""
            }
         ],
         "id":"sample-contract",
         "name":"Test Document"
      }
   ],
   "status":"SENT",
   "type":"PACKAGE",
   "roles":[
      {
         "id":"Role1",
         "type":"SIGNER",
         "signers":[
            {
               "id":"Signer1",
               "email":"[email protected]",
               "firstName":"1.firstname",
               "lastName":"1.lastname"
            }
         ],
         "name":"Role1"
      },
      {
         "id":"Role2",
         "type":"SIGNER",
         "signers":[
            {
               "id":"Signer2",
               "email":"[email protected]",
               "firstName":"2.firstname",
               "lastName":"2.lastname"
            }
         ],
         "name":"Role2"
      }
   ],
   "name":"Example Package"
}
Hope this could help you!

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Bare Minimum fields required for new Package upload?

0 votes
Guys - Thanks for the replies as they both helped!

Reply to: Bare Minimum fields required for new Package upload?

0 votes
Great! We're always glad to help! Let us know whenever you have any questions.

- Michael Partner and Developer Technologies Manager, OneSpan Facebook - Twitter - LinkedIn


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