Skip to content

Latest commit

 

History

History
266 lines (178 loc) · 6.58 KB

WebhooksApi.md

File metadata and controls

266 lines (178 loc) · 6.58 KB

LaunchDarklyApi.WebhooksApi

All URIs are relative to https://app.launchdarkly.com

Method HTTP request Description
deleteWebhook DELETE /api/v2/webhooks/{id} Delete webhook
getAllWebhooks GET /api/v2/webhooks List webhooks
getWebhook GET /api/v2/webhooks/{id} Get webhook
patchWebhook PATCH /api/v2/webhooks/{id} Update webhook
postWebhook POST /api/v2/webhooks Creates a webhook

deleteWebhook

deleteWebhook(id)

Delete webhook

Delete a webhook by ID.

Example

import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';

let apiInstance = new LaunchDarklyApi.WebhooksApi();
let id = "id_example"; // String | The ID of the webhook to delete
apiInstance.deleteWebhook(id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
});

Parameters

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

Return type

null (empty response body)

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getAllWebhooks

Webhooks getAllWebhooks()

List webhooks

Fetch a list of all webhooks.

Example

import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';

let apiInstance = new LaunchDarklyApi.WebhooksApi();
apiInstance.getAllWebhooks((error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

This endpoint does not need any parameter.

Return type

Webhooks

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getWebhook

Webhook getWebhook(id)

Get webhook

Get a single webhook by ID.

Example

import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';

let apiInstance = new LaunchDarklyApi.WebhooksApi();
let id = "id_example"; // String | The ID of the webhook
apiInstance.getWebhook(id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
id String The ID of the webhook

Return type

Webhook

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

patchWebhook

Webhook patchWebhook(id, patchOperation)

Update webhook

Update a webhook's settings. Updating webhook settings uses a JSON patch representation of the desired changes. To learn more, read Updates.

Example

import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';

let apiInstance = new LaunchDarklyApi.WebhooksApi();
let id = "id_example"; // String | The ID of the webhook to update
let patchOperation = [{"op":"replace","path":"/on","value":false}]; // [PatchOperation] | 
apiInstance.patchWebhook(id, patchOperation, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
id String The ID of the webhook to update
patchOperation [PatchOperation]

Return type

Webhook

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

postWebhook

Webhook postWebhook(webhookPost)

Creates a webhook

Create a new webhook.

Example

import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';

let apiInstance = new LaunchDarklyApi.WebhooksApi();
let webhookPost = {"name":"apidocs test webhook","on":true,"sign":false,"statements":[{"actions":["*"],"effect":"allow","resources":["proj/test"]}],"tags":["example-tag"],"url":"https://example.com"}; // WebhookPost | 
apiInstance.postWebhook(webhookPost, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
webhookPost WebhookPost

Return type

Webhook

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json