Axway Integration Builder – Syncplicity Events – Part 1

Axway Integration Builder
Axway Integration Builder

Axway recently added support for events in its Integration Builder Syncplicity connector. This means that you can create Integration Builder flows that are triggered when an event occurs in your Syncplicity tenant. The events include file upload, file modify, file delete, folder create, folder delete and folder sharing. A complete list of the events can be found here.

This can be very useful for creating notification flows for certain Syncplicity related business processes. For example, notifying your Customer Success Team via Slack or Microsoft Teams whenever there is a certain activity in a shared folder.

It’s simple to set up. Let’s get started.

Enable Events in the Connector

Here are the steps for creating the connector

  • Create an instance of the Syncplicity connector

  • Enter the email address associated with your account and click on the Events Enabled switch to enable and set the polling interval to the desired value.

  • Click on the Create Instance button and enter any requested information

That’s it! You now have a Syncplicity connector that will poll Syncplicity and create an Integration Builder event whenever there is an event in Syncplicity.

Use the Connector in a Flow

Create the Flow Template

Let’s create a simple flow that uses the connector and see how it works and what data is available in the trigger.

  • Create a new flow and select Event for the trigger

  • Create a Connector Instance Variable

Note that if you unsure how to accomplish this, then check out the other Integration blog posts on Axway’s developer blog for detailed instructions as this has been covered before

  • Add a JS Script step to the trigger and log the trigger to the console as follows:
console.log(trigger);
  • Your flow should look similar to the following:

Create the Flow Instance

  • Click on Create Instance on your flow tile
  • Enter a name for your instance and attach the connector created above

  • Click Create Instance

Test The Flow

  • Click on executions on the instance tile to view executions

  • Log into your Syncplicity instance and upload a file to a folder

  • Depending on your polling interval you will soon see an execution in your flow corresponding to the Syncplicity file upload

Note that each event generates a trigger. I have three executions above because I actually uploaded a file, deleted and uploaded another file

  • The full trigger (from the console log) is shown below:
```javascript
{
  "eventId": "AW1t6pEbaxsHCk98fnMD",
  "instanceId": 202228,
  "body": {
    "message": {
      "eventId": "AW1t6pEbaxsHCk98fnMD",
      "instanceName": "SyncP GL Event",
      "instanceTags": [
        "SyncP GL Event"
      ],
      "raw": {
        "pollDate": 1569507145602,
        "documents": [
          {
            "EventDate": 1569507095583,
            "EventSource": 3,
            "Type": 2,
            "Message": "FileCreated",
            "Id": 6420299379,
            "File": {
              "LatestVersionId": 862782955841001,
              "Length": 1006708,
              "LastWriteTimeUtc": "2019-09-26T14:11:35.5130000Z",
              "SyncpointId": 9938806,
              "Filename": "file_example_PNG_1MB.png",
              "FileId": 862782955839001,
              "FolderId": 799869226652001,
              "VirtualPath": "\\",
              "DateAddedUtc": "2019-09-26T14:11:35.5670000Z",
              "CreationTimeUtc": "2019-09-26T14:11:35.5130000Z"
            }
          }
        ],
        "eventHeaders": {
          "id": "202228",
          "encodedid": "MjAyMjI4",
          "Raw-Element-Key": "syncplicity"
        },
        "objectType": "documents"
      },
      "userId": 21107,
      "elementKey": "syncplicity",
      "accountId": 18281,
      "companyId": 7861,
      "instanceId": 202228,
      "instance_id": 202228,
      "events": [
        {
          "date": "2019-09-26T14:11:35Z",
          "elementKey": "syncplicity",
          "pollDate": "2019-09-26T14:12:25Z",
          "eventType": "CREATED",
          "hubKey": "documents",
          "objectId": "1-9938806-862782955839001",
          "objectType": "file"
        }
      ]
    }
  },
  "type": "event",
  "event": {
    "date": "2019-09-26T14:11:35Z",
    "elementKey": "syncplicity",
    "pollDate": "2019-09-26T14:12:25Z",
    "eventType": "CREATED",
    "hubKey": "documents",
    "objectId": "1-9938806-862782955839001",
    "objectType": "file"
  }
}
```

Note that the trigger contains a lot of useful information to help you with your flow logic

Summary

In this blog post, we learned how to set up an Integration Builder Syncplicity connector to poll for events. We also used the connector in a simple flow and observed that data provided in the event trigger.

Learn how to create an OpenCage Geocode Connector in an AMPLIFY Integration Builder.

In future blog posts, we’ll create a more advanced flow that leverages Syncplicity events.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.