Skip to content

Latest commit

 

History

History
422 lines (280 loc) · 9.14 KB

WebhookApi.md

File metadata and controls

422 lines (280 loc) · 9.14 KB

Apideck.Webhook

Class Name

WebhookApi

Methods

List Event Logs

Method: eventLogsAll

webhookApi.eventLogsAll(body)

Parameters

Name Type Description Notes
appId [string] The ID of your Unify application (optional)
cursor [string] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. (optional)
limit [number] Number of results to return. Minimum 1, Maximum 200, Default 20 (optional) defaults to 20
filter WebhookEventLogsFilter Filter results (optional)

Response Type

GetWebhookEventLogsResponse

HTTP response details

Status code Description
200 EventLogs
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID'
});

const params = {}

try {
  const { data } = await apideck.webhook.eventLogsAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Create Webhook Subscription

Method: webhooksAdd

webhookApi.webhooksAdd(body)

Parameters

Name Type Description Notes
webhook CreateWebhookRequest
appId [string] The ID of your Unify application (optional)

Response Type

CreateWebhookResponse

HTTP response details

Status code Description
201 Webhooks
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID'
});

const params = {
  webhook: {
    description: 'A description',
    unified_api: 'crm',
    status: 'enabled',
    delivery_url: 'https://example.com/my/webhook/endpoint',
    events: [
      'vault.connection.created',
      'vault.connection.updated'
    ]
  }
}

try {
  const { data } = await apideck.webhook.webhooksAdd(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

List Webhook Subscriptions

Method: webhooksAll

webhookApi.webhooksAll(body)

Parameters

Name Type Description Notes
appId [string] The ID of your Unify application (optional)
cursor [string] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. (optional)
limit [number] Number of results to return. Minimum 1, Maximum 200, Default 20 (optional) defaults to 20

Response Type

GetWebhooksResponse

HTTP response details

Status code Description
200 Webhooks
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID'
});

const params = {}

try {
  const { data } = await apideck.webhook.webhooksAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Delete Webhook Subscription

Method: webhooksDelete

webhookApi.webhooksDelete(body)

Parameters

Name Type Description Notes
id [string] JWT Webhook token that represents the unifiedApi and applicationId associated to the event source.
appId [string] The ID of your Unify application (optional)

Response Type

DeleteWebhookResponse

HTTP response details

Status code Description
200 Webhooks
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.webhook.webhooksDelete(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Webhook Subscription

Method: webhooksOne

webhookApi.webhooksOne(body)

Parameters

Name Type Description Notes
id [string] JWT Webhook token that represents the unifiedApi and applicationId associated to the event source.
appId [string] The ID of your Unify application (optional)

Response Type

GetWebhookResponse

HTTP response details

Status code Description
200 Webhooks
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.webhook.webhooksOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Update Webhook Subscription

Method: webhooksUpdate

webhookApi.webhooksUpdate(body)

Parameters

Name Type Description Notes
webhook UpdateWebhookRequest
id [string] JWT Webhook token that represents the unifiedApi and applicationId associated to the event source.
appId [string] The ID of your Unify application (optional)

Response Type

UpdateWebhookResponse

HTTP response details

Status code Description
200 Webhooks
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID'
});

const params = {
  id: 'id_example',
  webhook: {
    description: 'A description',
    status: 'enabled',
    delivery_url: 'https://example.com/my/webhook/endpoint',
    events: [
      'vault.connection.created',
      'vault.connection.updated'
    ]
  }
}

try {
  const { data } = await apideck.webhook.webhooksUpdate(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]