Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added example payload for API endpoint for creating webhooks #147

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 29 additions & 14 deletions source/includes/authenticated_api/_webhook_endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Webhooks can be used by software engineers to integrate ControlShift with third-party systems. They allow engineers to build software that is triggered by events that take place within ControlShift. This authenticated endpoint provides information about webhook endpoints and allows for the creation of new ones.

This is useful for customers who would like to build automated reporting to detect when webhooks have been disabled or are setup incorrectly.
This is useful for customers who would like to build automated reporting to detect when webhooks have been disabled or are setup incorrectly.

### List Webhook Endpoints

Expand Down Expand Up @@ -35,28 +35,43 @@ Show information about all of the webhook endpoints configured for organisation.
]
```

### Create Webhook Endpoint

Creates a new webhook endpoint that will receive webhooks from the platform.
<div></div>

`POST /api/v1/webhook_endpoints`
### Create Webhook Endpoint
> POST /api/v1/webhook_endpoints

The request body should be a JSON block containing one `"endpoint"` object, which can have the following properties:
```json
{
"endpoint": {
"url": "https://example.com/test1",
"basic_auth_username": "my_secret_user",
"basic_auth_password": "passw0rd",
"aws_account_id": "355687156842"
}
}
```

Field | Type | Description | Required?
------|--------|--------------------------------------------------------------|----------
url | string | URL webhook will be POSTed to. | yes
basic_auth_username | string | Optional. HTTP Basic Auth credential to use with your endpoint | no
basic_auth_password | string | | no
aws_account_id | string | Optional. Advanced feature. See Bulk Data API docs | no
> Response body

Successful response
```json
{
"status": "success",
"endpoint": {
"url": "https://example.com",
"url": "https://example.com/test1",
"signing_secret": "abc122"
}
}
```

Creates a new webhook endpoint that will receive webhooks from the platform.

`POST /api/v1/webhook_endpoints`

The request body should be a JSON block containing one `"endpoint"` object, which can have the following properties:

Field | Type | Description | Required?
--------------------|--------|----------------------------------------------------------------|----------
url | string | URL webhook will be POSTed to. | yes
basic_auth_username | string | Optional. HTTP Basic Auth credential to use with your endpoint | no
basic_auth_password | string | | no
aws_account_id | string | Optional. Advanced feature. See Bulk Data API docs | no
Loading