new V2_WebhooksAPI(rest)
This class is used to interact with Webhooks in TidyHQ.
Parameters:
Name | Type | Description |
---|---|---|
rest | Rest | The rest instance to use for requests. |
- Source
Methods
(async) activateWebhook(id, optionsopt) → {Promise.<TidyAPI_EmptyResponse>}
This function is used to activate a Webhook.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
id | string | The ID of the Webhook. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- An empty response.
- Type:
- Promise.<TidyAPI_EmptyResponse>
(async) createWebhook(url, matching_kind, description, optionsopt) → {Promise.<TidyAPI_V2_Webhook>}
Create a new Webhook.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url | string | The URL of the Webhook to listen to. | ||||||||||||||
matching_kind | string | The kind of event to listen for. | ||||||||||||||
description | string | The description of the Webhook. | ||||||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- The new Webhook.
- Type:
- Promise.<TidyAPI_V2_Webhook>
(async) deactivateWebhook(id, optionsopt) → {Promise.<TidyAPI_EmptyResponse>}
Deactivate a Webhook.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
id | string | The ID of the Webhook. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- An empty response.
- Type:
- Promise.<TidyAPI_EmptyResponse>
(async) deleteWebhook(id, optionsopt) → {Promise.<TidyAPI_EmptyResponse>}
Delete a Webhook.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
id | string | The ID of the Webhook. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- An empty response.
- Type:
- Promise.<TidyAPI_EmptyResponse>
(async) getWebhook(id, optionsopt) → {Promise.<TidyAPI_V2_Webhook>}
Get a Webhook by its ID.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
id | string | The ID of the Webhook. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- The Webhook.
- Type:
- Promise.<TidyAPI_V2_Webhook>
(async) getWebhooks(optionsopt) → {Promise.<TidyAPI_V2_Webhooks>}
Get a list of all Webhooks.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | <optional> | {} | Properties
|
- Source
Returns:
- The list of Webhooks.
- Type:
- Promise.<TidyAPI_V2_Webhooks>