All URIs are relative to https://app.launchdarkly.com
Method | HTTP request | Description |
---|---|---|
delete_webhook | DELETE /api/v2/webhooks/{id} | Delete webhook |
get_all_webhooks | GET /api/v2/webhooks | List webhooks |
get_webhook | GET /api/v2/webhooks/{id} | Get webhook |
patch_webhook | PATCH /api/v2/webhooks/{id} | Update webhook |
post_webhook | POST /api/v2/webhooks | Creates a webhook |
delete_webhook(id)
Delete webhook
Delete a webhook by ID.
require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
# Configure API key authorization: ApiKey
config.api_key['ApiKey'] = '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['ApiKey'] = 'Bearer'
end
api_instance = LaunchDarklyApi::WebhooksApi.new
id = 'id_example' # String | The ID of the webhook to delete
begin
# Delete webhook
api_instance.delete_webhook(id)
rescue LaunchDarklyApi::ApiError => e
puts "Error when calling WebhooksApi->delete_webhook: #{e}"
end
This returns an Array which contains the response data (nil
in this case), status code and headers.
<Array(nil, Integer, Hash)> delete_webhook_with_http_info(id)
begin
# Delete webhook
data, status_code, headers = api_instance.delete_webhook_with_http_info(id)
p status_code # => 2xx
p headers # => { ... }
p data # => nil
rescue LaunchDarklyApi::ApiError => e
puts "Error when calling WebhooksApi->delete_webhook_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
id | String | The ID of the webhook to delete |
nil (empty response body)
- Content-Type: Not defined
- Accept: application/json
get_all_webhooks
List webhooks
Fetch a list of all webhooks.
require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
# Configure API key authorization: ApiKey
config.api_key['ApiKey'] = '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['ApiKey'] = 'Bearer'
end
api_instance = LaunchDarklyApi::WebhooksApi.new
begin
# List webhooks
result = api_instance.get_all_webhooks
p result
rescue LaunchDarklyApi::ApiError => e
puts "Error when calling WebhooksApi->get_all_webhooks: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_all_webhooks_with_http_info
begin
# List webhooks
data, status_code, headers = api_instance.get_all_webhooks_with_http_info
p status_code # => 2xx
p headers # => { ... }
p data # => <Webhooks>
rescue LaunchDarklyApi::ApiError => e
puts "Error when calling WebhooksApi->get_all_webhooks_with_http_info: #{e}"
end
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
get_webhook(id)
Get webhook
Get a single webhook by ID.
require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
# Configure API key authorization: ApiKey
config.api_key['ApiKey'] = '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['ApiKey'] = 'Bearer'
end
api_instance = LaunchDarklyApi::WebhooksApi.new
id = 'id_example' # String | The ID of the webhook
begin
# Get webhook
result = api_instance.get_webhook(id)
p result
rescue LaunchDarklyApi::ApiError => e
puts "Error when calling WebhooksApi->get_webhook: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_webhook_with_http_info(id)
begin
# Get webhook
data, status_code, headers = api_instance.get_webhook_with_http_info(id)
p status_code # => 2xx
p headers # => { ... }
p data # => <Webhook>
rescue LaunchDarklyApi::ApiError => e
puts "Error when calling WebhooksApi->get_webhook_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
id | String | The ID of the webhook |
- Content-Type: Not defined
- Accept: application/json
patch_webhook(id, patch_operation)
Update webhook
Update a webhook's settings. The request should be a valid JSON Patch document describing the changes to be made to the webhook.
require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
# Configure API key authorization: ApiKey
config.api_key['ApiKey'] = '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['ApiKey'] = 'Bearer'
end
api_instance = LaunchDarklyApi::WebhooksApi.new
id = 'id_example' # String | The ID of the webhook to update
patch_operation = [LaunchDarklyApi::PatchOperation.new({op: 'replace', path: '/exampleField', value: new example value})] # Array<PatchOperation> |
begin
# Update webhook
result = api_instance.patch_webhook(id, patch_operation)
p result
rescue LaunchDarklyApi::ApiError => e
puts "Error when calling WebhooksApi->patch_webhook: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> patch_webhook_with_http_info(id, patch_operation)
begin
# Update webhook
data, status_code, headers = api_instance.patch_webhook_with_http_info(id, patch_operation)
p status_code # => 2xx
p headers # => { ... }
p data # => <Webhook>
rescue LaunchDarklyApi::ApiError => e
puts "Error when calling WebhooksApi->patch_webhook_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
id | String | The ID of the webhook to update | |
patch_operation | Array<PatchOperation> |
- Content-Type: application/json
- Accept: application/json
post_webhook(webhook_post)
Creates a webhook
Create a new webhook.
require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
# Configure API key authorization: ApiKey
config.api_key['ApiKey'] = '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['ApiKey'] = 'Bearer'
end
api_instance = LaunchDarklyApi::WebhooksApi.new
webhook_post = LaunchDarklyApi::WebhookPost.new({url: 'http://www.example.com', sign: true, on: true}) # WebhookPost |
begin
# Creates a webhook
result = api_instance.post_webhook(webhook_post)
p result
rescue LaunchDarklyApi::ApiError => e
puts "Error when calling WebhooksApi->post_webhook: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> post_webhook_with_http_info(webhook_post)
begin
# Creates a webhook
data, status_code, headers = api_instance.post_webhook_with_http_info(webhook_post)
p status_code # => 2xx
p headers # => { ... }
p data # => <Webhook>
rescue LaunchDarklyApi::ApiError => e
puts "Error when calling WebhooksApi->post_webhook_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
webhook_post | WebhookPost |
- Content-Type: application/json
- Accept: application/json