Cloud Elements supports events via polling or webhooks depending on the API provider. For more information about our Events framework, see Events Overview.
Supported Events and Resources
Cloud Elements supports events via webhooks for Amazon S3.
Webhooks
You can configure webhooks through the UI or through API in the JSON body of the /instances
API call. First, you must set up webhooks on the Amazon website. Cloud Elements uses Simple Notification Service (SNS) to enable notifications for Amazon S3.
Configure Webhooks
Follow these steps to configure webhooks for Amazon S3
- Via a web browser, go to https://aws.amazon.com/console/
- SIgn in to Amazon Web Services using your credentials.
- Once logged in, enter SNS in the search bar.
- On the navigation panel to your left, click Topics.
- On the top right corner of the page, click Create Topic.
- Enter a Topic name and Display Name (optional).
- Click on Access Policy.
- Choose the Advanced method to define your policy using a JSON object.
- In the JSON editor, enter the Service i.e. Amazon S3's domain name.
- Add the Resource name and the Arn link i.e. your S3 bucket name in the JSON.
- Click on the Create topic button.
Use the Topic ARN and Topic Name on Cloud Elements platform to enable webhooks for Amazon S3.
Configure Webhooks Through the UI
To configure webhooks through the UI, follow the same steps to authenticate an element instance, and then turn on events. Fill in the two mandatory fields that appear -
- SNS Topic Key - Amazon S3 Topic ARN that you recorded while configuring Webhooks on the AWS Console.
- SNS Topic Name - Amazon Topic Name that you entered while creating a topic on the AWS Console.
For more information, see Authenticate an Element Instance with Events (UI) or the element-specific authentication topic.
Configure Webhooks Through API
To add webhooks when authenticating through the /instances
API call, add the following to the configuration
object in the JSON body. For more information about each parameter described here, see Parameters.
{
"event.notification.enabled": true,
"event.vendor.type": "webhooks",
"validate.instance": true,
"event.sns.topic.arn": "<INSERT_TOPIC_ARN>",
"event.sns.topic.name": "<INSERT_TOPIC_NAME>"
}
event.notification.signature.key
is optional.Example JSON with Webhooks
Instance JSON with webhooks events enabled:
{
"element": {
"key": "amazons3"
},
"configuration": {
"filter.response.nulls": "true",
"event.vendor.type": "webhooks",
"event.notification.enabled": true,
"validate.instance": "true",
"event.sns.topic.arn": "xxxxxxxxxx",
"event.sns.topic.name": "xxxxxxxxxx",
"filemanagement.provider.access_key": "******",
"filemanagement.provider.secret_key": "******",
"filemanagement.provider.bucket_name": "xxxxxxxxxx",
"filemanagement.provider.region_name": "xxxxxxxxxx"
},
"tags": [
"<Add_Your_Tag>"
],
"name": "<INSTANCE_NAME>"
}
Parameters
API parameters are in code formatting
.
Parameter | Description | Data Type |
---|---|---|
key | The element key. amazons3 | string |
Namename | The name for the element instance created during authentication. | string |
Events Enabledevent.notification.enabled | Optional. Identifies that events are enabled for the element instance. Default: false | boolean |
Event Typeevent.vendor.type | Optional. Identifies the type of events enabled for the instance, either webhook or polling . | string |
Event Notification Callback URLevent.notification.callback.url | For webhooks and polling. The URL where your app can receive events. | string |
Callback Notification Signature Keyevent.notification.signature.key | For webhooks and polling. Optional A user-defined key for added security to show that events have not been tampered with. This can be any custom value that you want passed to the callback handler listening at the provided Event Notification Callback URL. | string |
Objects to Monitor for Changesevent.objects | For webhooks and polling. Optional Comma separated list of objects to monitor for changes. | string |
Configure Pollingevent.poller.configuration | Optional*. Configuration parameters for polling. | JSON object |
tags | Optional. User-defined tags to further identify the instance. | string |