dcarney

Specifying Template Id when creating new package

0 votes

I'm trying to use the One Span API to create a package from a template. In the list of api calls 

https://community.onespan.com/products/onespan-sign/sandbox#/

I sese

/api/packages/{packageId}/clone

Creates a package or template from an existing package or template. To create a template, the "type" in the request body has to be set to "TEMPLATE".

Using this, where do I specify which template id to use?

 


Reply to: Specifying Template Id when creating new package

0 votes

Hi Dan,

 

Thanks for your post!

(1)You'd set the template ID via the API path:
POST /api/packages/{templateId}/clone

(2)In the payload, you can replace placeholder signer, update some package level settings, and to set field values, see below example JSON:
 

{
  "description": "",
  "documents": [
    {
      "id": "Document1",
      "name": "Document1",
      "index": 1,
      "approvals": [
        {
          "role": "b17cde62-181b-45a7-9643-d75c42872226",
          "id": "zwQBbwKQ7p00",
          "fields": [
            {
              "binding": null,
              "validation": {
                "group": "",
                "required": false,
                "maxLength": null,
                "minLength": null,
                "errorMessage": "",
                "disabled": false,
                "errorCode": null,
                "minimumRequired": null,
                "maximumRequired": null,
                "enum": null,
                "pattern": ""
              },
              "id": "lnt6MykHtisZ",
              "data": null,
              "fontSize": null,
              "subtype": "TEXTFIELD",
              "page": 0,
              "extractAnchor": null,
              "formattedValue": "",
              "left": 91.0,
              "width": 165.0,
              "height": 37.0,
              "extract": false,
              "top": 348.0,
              "type": "INPUT",
              "value": "some dynamic value",
              "name": ""
            },
            {
              "binding": null,
              "validation": null,
              "id": "2t1cgWgdXTA3",
              "data": null,
              "fontSize": null,
              "subtype": "FULLNAME",
              "page": 0,
              "extractAnchor": null,
              "formattedValue": "",
              "left": 117.0,
              "width": 165.0,
              "height": 37.0,
              "extract": false,
              "top": 509.0,
              "type": "SIGNATURE",
              "value": "",
              "name": ""
            }
          ]
        }
      ]
    }
  ],
  "due": null,
  "emailMessage": "",
  "language": "en",
  "roles": [
    {
      "id": "b17cde62-181b-45a7-9643-d75c42872226",
      "emailMessage": {
        "content": ""
      },
      "reassign": false,
      "deliverDocumentsByEmail": false,
      "attachmentRequirements": [],
      "type": "SIGNER",
      "index": 0,
      "signers": [
        {
          "firstName": "john",
          "lastName": "smith",
          "email": "[email protected]"
        }

      ],
      "name": "Signer1"
    }
  ],
  "settings": {
    "ceremony": {
      "declineButton": true,
      "declineReasons": [],
      "disableDeclineOther": false,
      "disableDownloadForUncompletedPackage": false,
      "disableFirstInPersonAffidavit": false,
      "disableInPersonAffidavit": false,
      "disableOptOutOther": false,
      "disableSecondInPersonAffidavit": false,
      "documentToolbarOptions": null,
      "events": null,
      "handOver": null,
      "hideCaptureText": false,
      "hideLanguageDropdown": false,
      "hidePackageOwnerInPerson": false,
      "hideWatermark": false,
      "inPerson": false,
      "remoteOnlineNotarization": false,
      "maxAuthFailsAllowed": null,
      "optOutButton": false,
      "optOutReasons": [],
      "leftMenuExpand": false,
      "enforceCaptureSignature": false,
      "extractAcroFields": true,
      "extractTextTags": true,
      "ada": false,
      "fontSize": 14,
      "defaultTimeBasedExpiry": true,
      "remainingDays": 21,
      "maximumRemainingDays": 0,
      "maxAttachmentFiles": 0,
      "showNseHelp": false,
      "showNseOverview": false,
      "optionalNavigation": false,
      "showNseLogoInIframe": false,
      "geolocation": false,
      "adHocCobrowsingSigner": false,
      "timestampOnSignature": false,
      "layout": {
        "header": {
          "feedback": true,
          "breadcrumbs": true,
          "globalActions": {
            "hideEvidenceSummary": false,
            "confirm": true,
            "download": true,
            "saveAsLayout": false
          },
          "globalNavigation": true,
          "sessionBar": true,
          "titleBar": null
        },
        "footer": null,
        "brandingBar": null,
        "navigator": true,
        "iframe": false
      },
      "style": null
    }
  },
  "status": "SENT",
  "timezoneId": "Australia/Sydney",
  "data": {
    "senderVisible": false,
    "origin": "OSS"
  },
  "name": "transaction created out of template"
}

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Specifying Template Id when creating new package

0 votes

Thank you!

 


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