Class

Webhooks

Webhooks(client)

Class corresponding to Aworks Webhooks Endpoints
Constructor

# new Webhooks(client)

Endpoint constructor
Parameters:
Name Type Description
client Client
See:
  • [Webhooks in Awork API Docs](https://openapi.awork.com/#/Webhooks)

View Source endpoints/Webhooks.js, line 9

Classes

Webhooks

Methods

# async create(webhook) → {Promise.<Webhook>}

Creates a new webhook. The receiver type is inferred from the URI. All unknown receivers are treated as 'custom'.
Parameters:
Name Type Description
webhook WebhookCreateModel The model to create a webhook.

View Source endpoints/Webhooks.js, line 57

Promise.<Webhook>

# async delete(webhookId) → {Promise.<void>}

Deletes the webhook with the specified id.
Parameters:
Name Type Description
webhookId String The id of the webhook.

View Source endpoints/Webhooks.js, line 80

Promise.<void>

# async eventTypes() → {Promise.<Array.<String>>}

Returns all available event types for generic webhooks in Awork.

View Source endpoints/Webhooks.js, line 88

Promise.<Array.<String>>

# async get(webhookId) → {Promise.<WebHook>}

Returns the webhook with the specified id.
Parameters:
Name Type Description
webhookId String The id of the webhook.

View Source endpoints/Webhooks.js, line 24

Promise.<WebHook>

# async list(optionsopt) → {Promise.<Array.<Webhook>>}

Returns all configured webhooks of the workspace.
Parameters:
Name Type Attributes Description
options ListOptions <optional>
Pagination and filtering options.

View Source endpoints/Webhooks.js, line 35

Promise.<Array.<Webhook>>

# async logs(webhookId) → {Promise.<Array.<String>>}

Returns all logs of the webhook with the specified id.
Parameters:
Name Type Description
webhookId String The id of the webhook.

View Source endpoints/Webhooks.js, line 107

Promise.<Array.<String>>

# async slackEventTypes() → {Promise.<Array.<String>>}

Returns all available event types for Slack webhooks in Awork.

View Source endpoints/Webhooks.js, line 97

Promise.<Array.<String>>

# async update(webhookId, webhook) → {Promise.<Webhook>}

Updates the webhook with the specified id.
Parameters:
Name Type Description
webhookId String The id of the webhook.
webhook WebhookUpdateModel The model to update a webhook.

View Source endpoints/Webhooks.js, line 69

Promise.<Webhook>