Overview
Webhooks API allows you to manage your webhooks by making HTTP calls to the Etlworks API REST endpoints. If you want to know how to do this through a graphical user interface, please read this article.
Authentication
Before making a call to the built-in API, the user must receive a JWT token from the authentication API.
Step 1. Use any user with the Administrator
role to call an authentication endpoint and receive an access token.
Step 2. Use the access token received in Step 1 to call Etlworks API endpoints. The access token must be submitted as a header parameter, as in: Authorization:Bearer access-token
.
Access tokens are short-lived and self-expiring. An access token gives you access to the APIs for approximately 10 minutes. It is recommended that you refresh the access token before each call to the API.
Endpoints
Add new webhook
Request parameters
- PATH:
/rest/v1/webhooks
EXAMPLE: https://app.etlworks.com/rest/v1/webhooks
- METHOD:
POST
- HEADER:
Authorization:Bearer access-token
- REQUEST BODY: JSON document in the following Format:
-
{
"name": "Flow executed",
"description": "This webhook triggered after flow execution",
"events": [
"Flow.Executed"
],
"url": "https://webhook.site/87103317-693d-4ebd-a074-fd45340f0d54",
"method": "POST",
"contentType": "application/json",
"includeEntity": true,
"headers": [
{
"key": "X-Custom-Header",
"value": "some value"
}
],
"secret": "ZjZlZDdlOWE3OGQ0NTk4MTU1MjkzNDA0",
"basicUser": "admin",
"basicPass": "admin",
"enabled": true
}
- REQUEST CONTENT TYPE:
application/json
Response
The response is a JSON document in the following Format:
{
"id": 1,
"name": "Flow executed",
"description": "This webhook triggered after flow execution",
"events": [
"Flow.Executed"
],
"url": "https://webhook.site/87104317-693d-4ebd-a074-fd45340f0d54",
"method": "POST",
"contentType": "application/json",
"includeEntity": true,
"headers": [
{
"key": "X-Custom-Header",
"value": "some value"
}
],
"secret": "ZjZlZDdlOWE3OGQ0NTk4MTU1MjkzNDA0",
"basicUser": "admin",
"basicPass": "admin",
"enabled": true
}
Response Codes
- 200 for success
- 400 for not valid request body
- 401 for not authorized
- 403 for forbidden
- 500 for an internal error
Edit webhook
Request parameters
- PATH:
/rest/v1/webhooks/{webhookId}
EXAMPLE: https://app.etlworks.com/rest/v1/webhooks/1
- METHOD:
PUT
- HEADER:
Authorization:Bearer access-token
- REQUEST BODY: JSON document in the following Format:
-
{
"id": 1,
"name": "Flow executed",
"description": "This webhook triggered after flow execution",
"events": [
"Flow.Executed"
],
"url": "https://webhook.site/87103317-693d-4ebd-a074-fd45340f0d54",
"method": "POST",
"contentType": "application/json",
"includeEntity": true,
"headers": [
{
"key": "X-Custom-Header",
"value": "some value"
}
],
"secret": "ZjZlZDdlOWE3OGQ0NTk4MTU1MjkzNDA0",
"basicUser": "admin",
"basicPass": "admin",
"enabled": true
}
- REQUEST CONTENT TYPE:
application/json
Response
The response is a JSON document in the following Format:
{
"id": 1,
"name": "Flow executed",
"description": "This webhook triggered after flow execution",
"events": [
"Flow.Executed"
],
"url": "https://webhook.site/87103317-693d-4ebd-a074-fd45340f0d54",
"method": "POST",
"contentType": "application/json",
"includeEntity": true,
"headers": [
{
"key": "X-Custom-Header",
"value": "some value"
}
],
"secret": "ZjZlZDdlOWE3OGQ0NTk4MTU1MjkzNDA0",
"basicUser": "admin",
"basicPass": "admin",
"enabled": true
}
Response Codes
- 200 for success
- 400 for not valid request body
- 401 for not authorized
- 403 for forbidden
- 500 for an internal error
Delete webhook
Request parameters
- PATH:
/rest/v1/webhooks/{webhookId}
EXAMPLE: https://app.etlworks.com/rest/v1/webhooks/1
- METHOD:
DELETE
- HEADER:
Authorization:Bearer access-token
- REQUEST BODY: none
- REQUEST CONTENT TYPE: none
- RESPONSE: none
Response Codes
- 204 for success
- 401 for not authorized
- 403 for forbidden
- 500 for an internal error
Comments
0 comments
Please sign in to leave a comment.