AmigoCloud enables its users to add webhooks to get notified about certain actions on the server. Webhooks simply POST data in JSON format to a specific URL, or set of URLs, when triggered by some action on the server (a new project was created, a dataset was exported, etc).
Adding or deleting Webhooks:
To add/delete webhooks, follow these steps:
1. Go to your User Settings (Click on your email in the upper left corner, and select "User Settings" from the drop-down list).
2. There, you will find the Webhooks section. To create a new webhook, simply click on the plus button. Here you can point to your personal or company website, API, or web service. You can also add custom headers if you need to.
3. To delete a webhook, simply click on "Delete Webhook".
4. Your new webhooks configuration will be applied as soon as you click "Save". After doing this, you should start receiving POST requests everytime certain actions happen in any of your projects or projects you have access to.
Structure of the POST requests:
The POST request sent by AmigoCloud will have the following structure:
POST {webhook.URL}
Headers:
- Content-Type: application/json
- {webhook.headers}
Content:
{
"type": "project:creation_succeeded",
"id": "a2a0bbe305d544b682469331a07dcbd3",
"user_id": 1,
"project_id": 2,
"job": "eeb379bb8ad94ad49aaa6fc107a2e747"
"extra": ""/{}
}
Every request will include a "type" and an "id". The action that triggered the POST request will be indicated in "type", while "id" is a unique ID for the event/request. The rest of the information is related to the action and could or could not be present, depending on the type of action.
Trigger actions:
Here is a list of the actions that currently trigger a POST request. These actions are a subset of the websocket events.
project:creation_succeeded
- Sent when a project is created successfully.
- Includes: user id, project id, and asynchronous job hash.
- Receivers: all collaborators of the project (since it's a new project, just the owner).
project:deleted
- Sent when a project is deleted.
- Includes: user id, and project id.
- Receivers: all collaborators of the project.
user:accepted_invite
- Sent when a user accepts an invitation to join a project.
- Includes user id, and project id.
- Receivers: all collaborators of the project.
user:left_project
- Sent when a user leaves a project.
- Includes user id, and project id.
- Receivers: all collaborators of the project.
base_layer:created
- Sent when a base layer is created.
- Includes: user id, project id, and base layer id.
- Receivers: all collaborators of the project.
base_layer:deleted
- Sent when a base layer is deleted.
- Includes: user id, project id, and base layer id.
- Receivers: all collaborators of the project.
dataset:creation_failed
- Sent when a dataset fails to create (either from a file or created using the schema editor).
- Includes: user id, project id, dataset id, and asynchronous job hash.
- Receivers: all collaborators of the project.
dataset:creation_partial
- Sent when a dataset is created successfully, but some of the rows failed to load.
- Includes: user id, project id, dataset id, and asynchronous job hash.
- Receivers: all collaborators of the project.
dataset:creation_succeeded
- Sent when a dataset is created successfully.
- Includes: user id, project id, dataset id, and asynchronous job hash.
- Receivers: all collaborators of the project.
dataset:export_succeeded
- Sent when a requested export is generated successfully.
- Includes: user id, project id, dataset id, and asynchronous job hash (format and filename under extra).
- Receivers: all collaborators of the project.
dataset:deleted
- Sent when a dataset is deleted.
- Includes: user id, project id, and dataset id.
- Receivers: all collaborators of the project.
raster_dataset:creation_failed
- Sent when a raster dataset fails to create.
- Includes: user id, project id, dataset id, and asynchronous job hash.
- Receivers: all collaborators of the project.
raster_dataset:creation_succeeded
- Sent when a raster dataset is created successfully.
- Includes: user id, project id, dataset id, and asynchronous job hash.
- Receivers: all collaborators of the project.
raster_dataset:export_succeeded
- Sent when a requested export is generated successfully.
- Includes: user id, project id, dataset id, and asynchronous job hash (format and filename under extra).
- Receivers: all collaborators of the project.
raster_dataset:deleted
- Sent when a raster dataset is deleted.
- Includes: user id, project id, and dataset id.
- Receivers: all collaborators of the project.
If you have questions about webhooks or integrating AmigoCloud with your web service, contact us through the Contact Us page or email us at support@amigocloud.com.
Comments
0 comments
Please sign in to leave a comment.