Cloud Elements supports events via polling or webhooks depending on the endpoint. If you would like to see more information on our Events framework, please see the Event Management Guide.
Cloud Elements supports webhook events for Dropbox. For more information about webhooks at Dropbox including the currently available webhooks, see Dropbox's webhooks documentation.
You can configure webhooks through the UI or through API in the JSON body of the /instances
API call. Before you begin, make sure that you set up webhooks as described in API Provider Setup.
For more information about each field described here, see Parameters.
To authenticate an element instance with webhooks:
After successfully authenticating, we give you several options for next steps. Make requests using the API docs associated with the instance, map the instance to a virtual resource, or use it in a formula template.
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.notification.callback.url": "<INSERT_YOUR_APPS_CALLBACK_URL>",
"event.notification.signature.key": "<INSERT_KEY>"
}
event.notification.signature.key
is optional. Instance JSON with webhooks events enabled:
{
"element": {
"key": "dropbox"
},
"providerData": {
"code": "<AUTHORIZATION_GRANT_CODE>"
},
"configuration": {
"oauth.api.key": "<CLIENT_ID>",
"oauth.api.secret": "<CLIENT_SECRET>",
"oauth.callback.url": "https://www.mycoolapp.com/auth",
"event.notification.enabled": true,
"event.notification.callback.url": "<INSERT_YOUR_APPS_CALLBACK_URL>",
"event.notification.signature.key": "<INSERT_KEY>"
},
"tags": [
"<ADD_YOUR_TAGS>"
],
"name": "<INSTANCE_NAME>"
}
API parameters are in code formatting
.
Parameter | Description | Data Type |
---|---|---|
key |
The element key. dropbox |
string |
code |
The authorization grant code returned from the API provider in an OAuth2 authentication workflow. | string |
Namename |
The name for the element instance created during authentication. | string |
authentication.type |
Identifies how you are authenticating with Dropbox. Either oauth2 or apiKey . |
string |
oauth.callback.url |
OAuth 2.0 authentication only. The URL where you want to redirect users after they grant access. This is the Redirect URI that you noted in the API Provider Setup section. | string |
oauth.api.key |
OAuth 2.0 authentication only. The Client ID from Dropbox. This is the App key that you noted in the API Provider Setup section. | string |
oauth.api.secret |
OAuth 2.0 authentication only. The Client Secret from Dropbox. This is the App secret that you noted in the API Provider Setup section. | string |
Events Enabled event.notification.enabled |
Optional. Identifies that events are enabled for the element instance.Default: false |
boolean |
Event Notification Callback URLevent.notification.callback.url |
The URL where your app can receive events. This is the Webhook URI that you noted in the API Provider Setup section. | string |
Callback Notification Signature Key event.notification.signature.key |
OptionalA 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 |
tags | Optional. User-defined tags to further identify the instance. | string |