Webhooks ~~~~~~~~ List all webhooks +++++++++++++++++ .. http:get:: /fast-events/v1/admin/webhooks List all webhooks. **Optional query parameters** *_fields* A comma separated string of fields included in the response. For example ``name,topic``. **Example request** .. tabs:: .. code-tab:: bash $ curl \ -H "X-FE-API-KEY: 3zo58AUYP9zOE6YT" \ -H "Content-Type: application/json" \ -u "test:4ZAN O5OY OAvZ FZb2 Lslv JnJG" \ https://exampledomain.com/wp-json/fast-events/v1/admin/webhooks .. code-tab:: php false, ])); $result = curl_exec($ch); echo $result; .. code-tab:: python import requests from requests.auth import HTTPBasicAuth URL = 'https://exampledomain.com/wp-json/fast-events/v1/admin/webhooks/6' HEADERS = {'X-FE-API-KEY':'3zo58AUYP9zOE6YT'} AUTH = HTTPBasicAuth('test', '4ZAN O5OY OAvZ FZb2 Lslv JnJG') JSON = {'enabled': true} response = requests.put(URL, headers=HEADERS, auth=AUTH, json=JSON) print(response.json()) **Example response** .. sourcecode:: json { "id": 6, "name": "Demo webhook 1", "url": "https://detsws7x2mntaaq.m.pipedream.net", "secret": "asasasasas", "topic": "tickets.downloaded", "enabled": false, "retry_scheme": "1,1,2,4,8", "failure_threshold": 60, "pending": 0, "delivered": 1, "retries": 0, "failed": 0, "last_success": "2023-10-04 15:18:47", "last_retry": "0000-00-00 00:00:00", "last_failure": "0000-00-00 00:00:00", "date_created": "2023-10-04 11:51:35", "_links": { "self": [ { "href": "https://debug.fast-events.eu/wordpress/wp-json/fast-events/v1/admin/webhooks/6" } ], "collection": [ { "href": "https://debug.fast-events.eu/wordpress/wp-json/fast-events/v1/admin/webhooks" } ] } } **Changelog** .. csv-table:: :header: "Version", "Description" :width: 100% :widths: auto "2.0", "Introduced." ---- Delete webhook ++++++++++++++ .. http:delete:: /fast-events/v1/admin/webhooks/(integer:id) Delete a single webhook. **Example request** .. tabs:: .. code-tab:: bash $ curl \ -X DELETE \ -H "X-FE-API-KEY: 3zo58AUYP9zOE6YT" \ -H "Content-Type: application/json" \ -u "test:4ZAN O5OY OAvZ FZb2 Lslv JnJG" \ https://exampledomain.com/wp-json/fast-events/v1/admin/webhooks/6 .. code-tab:: php "Webhook 10", "url" => "https://detsws7x2mntaaq.m.pipedream.net", "secret" => "xx", "topic" => "tickets.downloaded", ])); $result = curl_exec($ch); echo $result; .. code-tab:: python import requests from requests.auth import HTTPBasicAuth URL = 'https://exampledomain.com/wp-json/fast-events/v1/admin/webhooks' HEADERS = {'X-FE-API-KEY':'3zo58AUYP9zOE6YT'} AUTH = HTTPBasicAuth('test', '4ZAN O5OY OAvZ FZb2 Lslv JnJG') JSON = {'name':'Webhook 10','url':'https://detsws7x2mntaaq.m.pipedream.net','secret':'xx','topic':'tickets.downloaded'} response = requests.post(URL, headers=HEADERS, auth=AUTH, json=JSON) print(response.json()) **Example response** .. sourcecode:: json { "id": 7, "name": "Webhook 1", "url": "https://detsws7x2mntaaq.m.pipedream.net", "secret": "xx", "topic": "tickets.downloaded", "enabled": false, "retry_scheme": "1,1,2,4,8", "failure_threshold": 60, "pending": 0, "delivered": 0, "retries": 0, "failed": 0, "last_success": "0000-00-00 00:00:00", "last_retry": "0000-00-00 00:00:00", "last_failure": "0000-00-00 00:00:00", "date_created": "2023-10-04 11:51:35", "_links": { "self": [ { "href": "https://debug.fast-events.eu/wordpress/wp-json/fast-events/v1/admin/webhooks/7" } ], "collection": [ { "href": "https://debug.fast-events.eu/wordpress/wp-json/fast-events/v1/admin/webhooks" } ] } } **Changelog** .. csv-table:: :header: "Version", "Description" :width: 100% :widths: auto "2.0", "Introduced." ---- Reset counters ++++++++++++++ .. http:get:: /fast-events/v1/admin/webhooks/(integer:id)/reset-counters Reset all counters and dates to zero. **Example request** .. tabs:: .. code-tab:: bash $ curl \ -X DELETE \ -H "X-FE-API-KEY: 3zo58AUYP9zOE6YT" \ -H "Content-Type: application/json" \ -u "test:4ZAN O5OY OAvZ FZb2 Lslv JnJG" \ https://exampledomain.com/wp-json/fast-events/v1/admin/webhooks/6 .. code-tab:: php