Skip to content

Latest commit

 

History

History
245 lines (166 loc) · 5.4 KB

WebhooksApi.md

File metadata and controls

245 lines (166 loc) · 5.4 KB

Bombbomb.WebhooksApi

All URIs are relative to https://api.bombbomb.com/v2

Method HTTP request Description
addWebHook POST /webhook Add Webhook
deleteWebHook DELETE /webhook/{hookId} Deletes Webhook
getWebHooks GET /webhook/ Lists Webhooks
listWebHookEvents GET /webhook/events Describe WebHook Events
sendWebhookExample POST /webhook/test Sends test Webhook

addWebHook

BBWebHook addWebHook(hookUrl)

Add Webhook

Idempotently adds a Webhook url

Example

var Bombbomb = require('bombbomb');
var defaultClient = Bombbomb.ApiClient.instance;

// Configure OAuth2 access token for authorization: BBOAuth2
var BBOAuth2 = defaultClient.authentications['BBOAuth2'];
BBOAuth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new Bombbomb.WebhooksApi();

var hookUrl = "hookUrl_example"; // String | The Url of your listener


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.addWebHook(hookUrl, callback);

Parameters

Name Type Description Notes
hookUrl String The Url of your listener

Return type

BBWebHook

Authorization

BBOAuth2

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

deleteWebHook

'String' deleteWebHook(hookId)

Deletes Webhook

Deletes a Webhook

Example

var Bombbomb = require('bombbomb');
var defaultClient = Bombbomb.ApiClient.instance;

// Configure OAuth2 access token for authorization: BBOAuth2
var BBOAuth2 = defaultClient.authentications['BBOAuth2'];
BBOAuth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new Bombbomb.WebhooksApi();

var hookId = "hookId_example"; // String | The id of the webhook to delete


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.deleteWebHook(hookId, callback);

Parameters

Name Type Description Notes
hookId String The id of the webhook to delete

Return type

'String'

Authorization

BBOAuth2

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

getWebHooks

[BBWebHook] getWebHooks()

Lists Webhooks

Lists all registered Webhooks

Example

var Bombbomb = require('bombbomb');
var defaultClient = Bombbomb.ApiClient.instance;

// Configure OAuth2 access token for authorization: BBOAuth2
var BBOAuth2 = defaultClient.authentications['BBOAuth2'];
BBOAuth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new Bombbomb.WebhooksApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getWebHooks(callback);

Parameters

This endpoint does not need any parameter.

Return type

[BBWebHook]

Authorization

BBOAuth2

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

listWebHookEvents

listWebHookEvents()

Describe WebHook Events

Returns example Webhook events for each kind of possible event.

Example

var Bombbomb = require('bombbomb');

var apiInstance = new Bombbomb.WebhooksApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.listWebHookEvents(callback);

Parameters

This endpoint does not need any parameter.

Return type

null (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

sendWebhookExample

sendWebhookExample()

Sends test Webhook

Triggers a test webhook to be sent to your endpoints.

Example

var Bombbomb = require('bombbomb');
var defaultClient = Bombbomb.ApiClient.instance;

// Configure OAuth2 access token for authorization: BBOAuth2
var BBOAuth2 = defaultClient.authentications['BBOAuth2'];
BBOAuth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new Bombbomb.WebhooksApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.sendWebhookExample(callback);

Parameters

This endpoint does not need any parameter.

Return type

null (empty response body)

Authorization

BBOAuth2

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json