From fae1103d618b1cc0b623383a06e2c63fe058ffec Mon Sep 17 00:00:00 2001 From: Azri Kahar <42867097+azrikahar@users.noreply.github.com> Date: Tue, 17 May 2022 18:37:01 +0800 Subject: [PATCH] remove webhooks from docs --- docs/.vuepress/config.js | 10 - docs/app/settings.md | 3 +- docs/configuration/webhooks.md | 38 -- docs/extensions/hooks.md | 8 +- docs/reference/system/webhooks.md | 594 ------------------------------ 5 files changed, 5 insertions(+), 648 deletions(-) delete mode 100644 docs/configuration/webhooks.md delete mode 100644 docs/reference/system/webhooks.md diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 264b802252..11274dc09a 100755 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -265,11 +265,6 @@ module.exports = { path: '/configuration/presets-bookmarks', title: 'Presets & Bookmarks', }, - { - type: 'page', - path: '/configuration/webhooks', - title: 'Webhooks', - }, { type: 'page', path: '/configuration/activity-log', @@ -439,11 +434,6 @@ module.exports = { path: '/reference/system/utilities', title: 'Utilities', }, - { - type: 'page', - path: '/reference/system/webhooks', - title: 'Webhooks', - }, ], }, { diff --git a/docs/app/settings.md b/docs/app/settings.md index 816668692f..b0757f3672 100644 --- a/docs/app/settings.md +++ b/docs/app/settings.md @@ -13,7 +13,7 @@ Only Administrators have access to the Settings Module. ::: -Settings are split into five distinct sections, each described below. +Settings are split into four distinct sections, each described below. - [Project Settings](/configuration/project-settings) — Setup branding and other global style options. - [Data Model](/configuration/data-model) — Create and modify [Collections](/getting-started/glossary/#collections), @@ -21,7 +21,6 @@ Settings are split into five distinct sections, each described below. [Fields](/getting-started/glossary/#fields). - [Roles & Permissions](/configuration/users-roles-permissions) — Create and manage access via Roles and Permissions. - [Presets & Bookmarks](/configuration/presets-bookmarks) — Set default views of data and configure bookmarks. -- [Webhooks](/configuration/webhooks) — Use platform events to trigger external services. Aside from the above pages, there are three shorthand links: diff --git a/docs/configuration/webhooks.md b/docs/configuration/webhooks.md deleted file mode 100644 index d5d0a4eb00..0000000000 --- a/docs/configuration/webhooks.md +++ /dev/null @@ -1,38 +0,0 @@ -# Webhooks - -> Webhooks are configured within the App (no code required) and send HTTP requests when a specific event is triggered. -> [Learn more about Webhooks](https://en.wikipedia.org/wiki/Webhook). - -## Creating Webhooks - -1. Navigate to **Settings chevron_right Webhooks** -2. Click add in the header -3. Complete the **other webhook form fields** outlined below - -- **Name** — A name to help remember this webhooks purpose -- **Method** — Send as either a HTTP `GET` or `POST` request -- **URL** — The URL to send the request to -- **Status** — Whether the webhook is active (enabled) or inactive (disabled) -- **Data** — Whether the event's data should be sent along with the request -- **Request Headers** — Custom headers that will be added to the webhook request -- **Trigger Actions** — The specific actions that will trigger the event -- **Trigger Collections** — The specific collections for which the above actions will trigger events - -## Disabling Webhooks - -1. Navigate to **Settings chevron_right Webhooks chevron_right - [Webhook]** -2. Set the **status field to inactive** - -## Deleting Webhooks - -1. Navigate to **Settings chevron_right Webhooks chevron_right - [Webhook]** -2. Click delete in the header -3. Confirm this decision by clicking **Delete** in the dialog - -::: danger Irreversible Change - -This action is permanent and can not be undone. Please proceed with caution. - -::: diff --git a/docs/extensions/hooks.md b/docs/extensions/hooks.md index e5b6d582a4..9ac1bb9483 100644 --- a/docs/extensions/hooks.md +++ b/docs/extensions/hooks.md @@ -158,8 +158,8 @@ export default ({ schedule }) => { ::: tip System Collections `` should be replaced with one of the system collection names `activity`, `collections`, `fields`, -`files` (except create/update), `folders`, `permissions`, `presets`, `relations`, `revisions`, `roles`, `settings`, -`users` or `webhooks`. +`files` (except create/update), `folders`, `permissions`, `presets`, `relations`, `revisions`, `roles`, `settings` or +`users`. ::: @@ -184,8 +184,8 @@ export default ({ schedule }) => { ::: tip System Collections `` should be replaced with one of the system collection names `activity`, `collections`, `fields`, -`files` (except create/update), `folders`, `permissions`, `presets`, `relations`, `revisions`, `roles`, `settings`, -`users` or `webhooks`. +`files` (except create/update), `folders`, `permissions`, `presets`, `relations`, `revisions`, `roles`, `settings` or +`users`. ::: diff --git a/docs/reference/system/webhooks.md b/docs/reference/system/webhooks.md deleted file mode 100644 index c1e465207a..0000000000 --- a/docs/reference/system/webhooks.md +++ /dev/null @@ -1,594 +0,0 @@ ---- -pageClass: page-reference ---- - -# Webhooks - -
-
- -> Webhooks are configured within the App (no code required) and send HTTP requests to an external service when a -> specific event is triggered. - -
-
- -[[toc]] - -
-
- ---- - -## The Webhook Object - -
-
-
- -`id` **integer**\ -Primary key of the webhook. - -`name` **string**\ -Name for the webhook. Shown in the Admin App. - -`method` **string**\ -HTTP method to use. One of `GET`, `POST`. - -`url` **string**\ -Where to send the request too. - -`status` **string**\ -Status of the webhook. One of `active`, `inactive`. - -`data` **boolean**\ -Whether or not to send the event data to the external endpoint. - -`actions` **csv**\ -When to fire the webhook. Can contain `create`, `update`, `delete`. - -`collections` **csv**\ -What collections to fire this webhook on. - -
-
-
- -```json -{ - "data": { - "id": 1, - "name": "Build Website", - "method": "POST", - "url": "https://example.com/", - "status": "active", - "data": true, - "actions": ["create", "update"], - "collections": ["articles"] - } -} -``` - -
-
- ---- - -## List Webhooks - -List all webhooks that exist in Directus. - -
-
- -### Query Parameters - -Supports all [global query parameters](/reference/query/). - -### Returns - -An array of up to [limit](/reference/query/#limit) [webhook objects](#the-webhook-object). If no items are available, -data will be an empty array. - -
-
- -### REST API - -``` -GET /webhooks -SEARCH /webhooks -``` - -[Learn more about SEARCH ->](/reference/introduction/#search-http-method) - -### GraphQL - -``` -POST /graphql/system -``` - -```graphql -type Query { - webhooks: [directus_webhooks] -} -``` - -##### Example - -```graphql -query { - webhooks { - url - method - } -} -``` - -
-
- ---- - -## Retrieve a Webhook - -List an existing webhook by primary key. - -
-
- -### Query Parameters - -Supports all [global query parameters](/reference/query). - -### Returns - -Returns the requested [webhook object](#the-webhook-object). - -
-
- -### REST API - -``` -GET /webhooks/:id -``` - -### GraphQL - -``` -POST /graphql/system -``` - -```graphql -type Query { - webhooks_by_id(id: ID!): directus_webhooks -} -``` - -##### Examples - -```graphql -query { - webhooks_by_id(id: 15) { - url - actions - method - } -} -``` - -
-
- ---- - -## Create a Webhook - -Create a new webhook. - -
-
- -### Query Parameters - -Supports all [global query parameters](/reference/query). - -### Request Body - -A partial [webhook object](#the-webhook-object). - -`name`, `actions`, `collections`, and `url` are required. - -### Returns - -Returns the [webhook object](#the-webhook-object) for the created webhook. - -
-
- -### REST API - -``` -POST /webhooks -``` - -##### Example - -```json -// POST /webhooks - -{ - "name": "Example", - "actions": ["create", "update"], - "collections": ["articles"], - "url": "https://example.com" -} -``` - -### GraphQL - -``` -POST /graphql/system -``` - -```graphql -type Mutation { - create_webhooks_item(data: create_directus_webhooks_input!): directus_webhooks -} -``` - -##### Example - -```graphql -mutation { - create_webhooks_item( - data: { name: "Example", actions: ["create", "update"], collections: ["articles"], url: "https://example.com" } - ) { - id - name - } -} -``` - -
-
- ---- - -## Create Multiple Webhook - -Create multiple new webhooks. - -
-
- -### Query Parameters - -Supports all [global query parameters](/reference/query). - -### Request Body - -An array of partial [webhook object](#the-webhook-object). - -`name`, `actions`, `collections`, and `url` are required. - -### Returns - -Returns the [webhook objects](#the-webhook-object) for the created webhooks. - -
-
- -### REST API - -``` -POST /webhooks -``` - -##### Example - -```json -// POST /webhooks - -[ - { - "name": "Example", - "actions": ["create", "update"], - "collections": ["articles"], - "url": "https://example.com" - }, - { - "name": "Second Example", - "actions": ["delete"], - "collections": ["articles"], - "url": "https://example.com/on-delete" - } -] -``` - -### GraphQL - -``` -POST /graphql/system -``` - -```graphql -type Mutation { - create_webhooks_items(data: [create_directus_webhooks_input!]!): [directus_webhooks] -} -``` - -##### Example - -```graphql -mutation { - create_webhooks_items( - data: [ - { name: "Example", actions: ["create", "update"], collections: ["articles"], url: "https://example.com" } - { name: "Second Example", actions: ["delete"], collections: ["articles"], url: "https://example.com/on-delete" } - ] - ) { - id - name - } -} -``` - -
-
- ---- - -## Update a Webhook - -Update an existing webhook. - -
-
- -### Query Parameters - -Supports all [global query parameters](/reference/query). - -### Request Body - -A partial [webhook object](#the-webhook-object). - -### Returns - -Returns the [webhook object](#the-webhook-object) for the updated webhook. - -
-
- -### REST API - -``` -PATCH /webhooks/:id -``` - -##### Example - -```json -// PATCH /webhooks/15 - -{ - "name": "Build Website" -} -``` - -### GraphQL - -``` -POST /graphql/system -``` - -```graphql -type Mutation { - update_webhooks_item(id: ID!, data: update_directus_webhooks_input!): directus_webhooks -} -``` - -##### Example - -```graphql -mutation { - update_webhooks_item(id: 15, data: { name: "Build Website" }) { - name - } -} -``` - -
-
- ---- - -## Update Multiple Webhooks - -Update multiple existing webhooks. - -
-
- -### Query Parameters - -Supports all [global query parameters](/reference/query). - -### Request Body - -
- -`keys` **Required**\ -Array of primary keys of the webhooks you'd like to update. - -`data` **Required**\ -Any of [the webhook object](#the-webhook-object)'s properties. - -
- -### Returns - -Returns the [webhook objects](#the-webhook-object) for the updated webhooks. - -
-
- -### REST API - -``` -PATCH /webhooks -``` - -##### Example - -```json -// PATCH /webhooks - -{ - "keys": [15, 41], - "data": { - "name": "Build Website" - } -} -``` - -### GraphQL - -``` -POST /graphql/system -``` - -```graphql -type Mutation { - update_webhooks_items(ids: [ID!]!, data: update_directus_webhooks_input!): [directus_webhooks] -} -``` - -##### Example - -```graphql -mutation { - update_webhooks_items(ids: [15, 41], data: { name: "Build Website" }) { - name - } -} -``` - -
-
- ---- - -## Delete a Webhook - -Delete an existing webhook. - -
-
- -### Returns - -Empty body. - -
-
- -### REST API - -``` -DELETE /webhooks/:id -``` - -##### Example - -``` -DELETE /webhooks/15 -``` - -### GraphQL - -``` -POST /graphql/system -``` - -```graphql -type Mutation { - delete_webhooks_item(id: ID!): delete_one -} -``` - -##### Example - -```graphql -mutation { - delete_webhooks_item(id: 15) { - id - } -} -``` - -
-
- ---- - -## Delete Multiple Webhooks - -Delete multiple existing webhooks. - -
-
- -### Request Body - -An array of webhook primary keys - -### Returns - -Empty body. - -
-
- -### REST API - -``` -DELETE /webhooks -``` - -##### Example - -```json -// DELETE /webhooks - -[2, 15, 41] -``` - -### GraphQL - -``` -POST /graphql/system -``` - -```graphql -type Mutation { - delete_webhooks_items(ids: [ID!]!): delete_many -} -``` - -##### Example - -```graphql -mutation { - delete_webhooks_items(ids: [2, 15, 41]) { - ids - } -} -``` - -
-
- ----