demellor

API Attachments Count or Change Options

0 votes

Is there a way via the API to get an a count of attachments for a transaction or a list of transactions and when they were added.  It doesn't appear new attachments change the Update Date.  We have people who are signing their transactions and then coming back multiple times to get the correct attachments added, which is our use case for knowing when new attachments are added

Richard DeMello


Reply to: API Attachments Count or Change Options

0 votes

Hi Richard,

 

From my test, it seems true that new attachment change (either sender rejected or signer uploaded new attachments) won't change the "update" date. But there's a corresponding callback notification for "PACKAGE_ATTACHMENT" event whenever signer uploaded a new attachment. Below is an example payload:

 

{"@class":"com.silanis.esl.packages.event.ESLProcessEvent","name":"PACKAGE_ATTACHMENT","sessionUser":"10f9ac91-2cfe-40de-83f1-58b94a58896e","packageId":"4fC6ccQn2Lz5rRJLXjdMm6XeSy4=","message":"driver licesne","documentId":null,"createdDate":"2020-12-02T15:19:19.388Z"}

where "sessionUser" refers to signer ID, "message" refers to the attachment Name

 

If you want to actively polling the upload date, it's hosted in the package JSON (GET /api/packages/{packageId}) > "roles" array > "attachmentRequirements" array > "files" array > "insertDate" : 1606921980000 (which is in unix timestamp)
 

  "roles": [

    {
      "id": "86f44d0b-c914-44f4-82e3-ca757075f5b3",
      "attachmentRequirements": [
        {
          "comment": "",
          "description": "driver license desc",
          "required": true,
          "status": "COMPLETE",
          "files": [
            {
              "id": 13932,
              "insertDate": 1606921980000,
              "name": "6pages - Copy.pdf",
              "preview": true
            }
          ],
          "id": "ZSju1QcCjT82",
          "name": "driver licesne",
          "data": null
        }
      ],
      "data": null,
      "index": 0,
      "type": "SIGNER",
      "name": "Signer1",

.....
    }

 

Duo

]

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: API Attachments Count or Change Options

0 votes

Is there a way to use the .NET interface to access the insertDate or is it just available in JSON?  I couldn't find an obvious way to access the package values for rols->attachmentRequirements via the .NET interface but maybe I just missed it.

Richard DeMello


Reply to: API Attachments Count or Change Options

0 votes

Hi Richard,

 

The "insertDate" of attachment files is there in the SDK modelling, however I found an issue with the SDK source code that the date was not correctly converted from long to Datetime. I will submit a ticket reporting this and at the mean time, you may have to grab the information using REST API.

Just for your curiosity, I was using below code and the file.InsertDate always points to year 1970.

 

            EslClient client = new EslClient(apiKey, apiUrl);
            DocumentPackage pkg = client.GetPackage(new PackageId("package_id"));
            Signer signer1 = pkg.GetSigner("[email protected]");
            foreach (AttachmentRequirement attachment in signer1.Attachments)
            {
                foreach (AttachmentFile file in attachment.Files)
                {
                    Debug.WriteLine($"attachment name: {attachment.Name}; attachment status: {attachment.Status}; file name: {file.Name}; file upload date: {file.InsertDate}");
                }
            }

 

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