Skip to content

Latest commit

 

History

History
269 lines (182 loc) · 6.4 KB

WebhooksApi.md

File metadata and controls

269 lines (182 loc) · 6.4 KB

LaunchDarklyApi::WebhooksApi

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

Method HTTP request Description
delete_webhook DELETE /webhooks/{resourceId} Delete a webhook by ID.
get_webhook GET /webhooks/{resourceId} Get a webhook by ID.
get_webhooks GET /webhooks Fetch a list of all webhooks.
patch_webhook PATCH /webhooks/{resourceId} Modify a webhook by ID.
post_webhook POST /webhooks Create a webhook.

delete_webhook

delete_webhook(resource_id, )

Delete a webhook by ID.

Example

# load the gem
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
  # Configure API key authorization: Token
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = LaunchDarklyApi::WebhooksApi.new

resource_id = 'resource_id_example' # String | The resource ID.


begin
  #Delete a webhook by ID.
  api_instance.delete_webhook(resource_id, )
rescue LaunchDarklyApi::ApiError => e
  puts "Exception when calling WebhooksApi->delete_webhook: #{e}"
end

Parameters

Name Type Description Notes
resource_id String The resource ID.

Return type

nil (empty response body)

Authorization

Token

HTTP request headers

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

get_webhook

Webhook get_webhook(resource_id, )

Get a webhook by ID.

Example

# load the gem
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
  # Configure API key authorization: Token
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = LaunchDarklyApi::WebhooksApi.new

resource_id = 'resource_id_example' # String | The resource ID.


begin
  #Get a webhook by ID.
  result = api_instance.get_webhook(resource_id, )
  p result
rescue LaunchDarklyApi::ApiError => e
  puts "Exception when calling WebhooksApi->get_webhook: #{e}"
end

Parameters

Name Type Description Notes
resource_id String The resource ID.

Return type

Webhook

Authorization

Token

HTTP request headers

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

get_webhooks

Webhooks get_webhooks

Fetch a list of all webhooks.

Example

# load the gem
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
  # Configure API key authorization: Token
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = LaunchDarklyApi::WebhooksApi.new

begin
  #Fetch a list of all webhooks.
  result = api_instance.get_webhooks
  p result
rescue LaunchDarklyApi::ApiError => e
  puts "Exception when calling WebhooksApi->get_webhooks: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

Webhooks

Authorization

Token

HTTP request headers

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

patch_webhook

Webhook patch_webhook(resource_id, patch_delta)

Modify a webhook by ID.

Example

# load the gem
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
  # Configure API key authorization: Token
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = LaunchDarklyApi::WebhooksApi.new

resource_id = 'resource_id_example' # String | The resource ID.

patch_delta = [LaunchDarklyApi::PatchOperation.new] # Array<PatchOperation> | Requires a JSON Patch representation of the desired changes to the project. 'http://jsonpatch.com/'


begin
  #Modify a webhook by ID.
  result = api_instance.patch_webhook(resource_id, patch_delta)
  p result
rescue LaunchDarklyApi::ApiError => e
  puts "Exception when calling WebhooksApi->patch_webhook: #{e}"
end

Parameters

Name Type Description Notes
resource_id String The resource ID.
patch_delta Array<PatchOperation> Requires a JSON Patch representation of the desired changes to the project. 'http://jsonpatch.com/&#39;

Return type

Webhook

Authorization

Token

HTTP request headers

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

post_webhook

Webhook post_webhook(webhook_body)

Create a webhook.

Example

# load the gem
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
  # Configure API key authorization: Token
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = LaunchDarklyApi::WebhooksApi.new

webhook_body = LaunchDarklyApi::WebhookBody.new # WebhookBody | New webhook.


begin
  #Create a webhook.
  result = api_instance.post_webhook(webhook_body)
  p result
rescue LaunchDarklyApi::ApiError => e
  puts "Exception when calling WebhooksApi->post_webhook: #{e}"
end

Parameters

Name Type Description Notes
webhook_body WebhookBody New webhook.

Return type

Webhook

Authorization

Token

HTTP request headers

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