Webhooks
If you are a Pro/Premium user you have the ability to add webhooks for a folderPair.
A webhook calls a specified HTTPS endpoint at the defined URL when an event occurs, as defined by you. Webhook URLs can be called using HTTP POST or GET methods. A configured endpoint needs to be using SSL (HTTPS), calling a non-encrypted HTTP website will not work.
Webhooks has the following configuration options:
- Name: Unique name of your choice.
- Webhook url: The webhook url to call. Must start with https://, all other urls will be ignored.
- HTTP method: POST or Get, POST enables posting body content with request.
- Which event should trigger webhook: The sync event for the current folderPair that should trigger webhook.
Errors and retry
A configured webhook will only be called once per sync, there is no retry if an error occurs.
POST webhook
For webhooks using POST method you can add parameters in the form of name/value pairs. These are added to the POST body as either JSON or form encoded parameters. For JSON the POST body will look like this:
{
"folderPairName": "Backup sync",
"syncStatus": "SyncOK",
"someName": "someValue",
"checkedFiles": 2, // not available in Starting sync webhook
"transferredFiles": 5, // not available in Starting sync webhook
"deletedFiles": 0 // not available in Starting sync webhook
}
The parameters folderPairName and syncStatus are added automatically to all POST content, for both JSON and form encoded body.
SyncStatus values
- SyncOK
- SyncFailed
- SyncCancelled
- SyncInProgress
- SyncConflict
- SyncStarted
- SyncFailedIllegalNetworkState
- SyncFailedNotEnoughSpace
- SyncFailedMissingWritePermission
- SyncFailedMissingManageFilesPermission
- SyncFailedNoAccountConfigured
- SyncFailedAnalysisError
- SyncFailedNoFilePathConfigured
- SyncFailedIsRoaming
- SyncFailedSSIDNotAllowed
- SyncFailedNotCharging
- SyncFailedVPNNotConnected