Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

Latest commit

 

History

History
335 lines (252 loc) · 9.22 KB

WebhooksApi.md

File metadata and controls

335 lines (252 loc) · 9.22 KB

LaunchDarkly.Api.Api.WebhooksApi

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

Method HTTP request Description
DeleteWebhook DELETE /webhooks/{resourceId} Delete a webhook by ID.
GetWebhook GET /webhooks/{resourceId} Get a webhook by ID.
GetWebhooks GET /webhooks Fetch a list of all webhooks.
PatchWebhook PATCH /webhooks/{resourceId} Modify a webhook by ID.
PostWebhook POST /webhooks Create a webhook.

DeleteWebhook

void DeleteWebhook (string resourceId)

Delete a webhook by ID.

Example

using System;
using System.Diagnostics;
using LaunchDarkly.Api.Api;
using LaunchDarkly.Api.Client;
using LaunchDarkly.Api.Model;

namespace Example
{
    public class DeleteWebhookExample
    {
        public void main()
        {
            
            // Configure API key authorization: Token
            Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");

            var apiInstance = new WebhooksApi();
            var resourceId = resourceId_example;  // string | The resource ID.

            try
            {
                // Delete a webhook by ID.
                apiInstance.DeleteWebhook(resourceId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling WebhooksApi.DeleteWebhook: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
resourceId string The resource ID.

Return type

void (empty response body)

Authorization

Token

HTTP request headers

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

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

GetWebhook

Webhook GetWebhook (string resourceId)

Get a webhook by ID.

Example

using System;
using System.Diagnostics;
using LaunchDarkly.Api.Api;
using LaunchDarkly.Api.Client;
using LaunchDarkly.Api.Model;

namespace Example
{
    public class GetWebhookExample
    {
        public void main()
        {
            
            // Configure API key authorization: Token
            Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");

            var apiInstance = new WebhooksApi();
            var resourceId = resourceId_example;  // string | The resource ID.

            try
            {
                // Get a webhook by ID.
                Webhook result = apiInstance.GetWebhook(resourceId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling WebhooksApi.GetWebhook: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
resourceId string The resource ID.

Return type

Webhook

Authorization

Token

HTTP request headers

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

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

GetWebhooks

Webhooks GetWebhooks ()

Fetch a list of all webhooks.

Example

using System;
using System.Diagnostics;
using LaunchDarkly.Api.Api;
using LaunchDarkly.Api.Client;
using LaunchDarkly.Api.Model;

namespace Example
{
    public class GetWebhooksExample
    {
        public void main()
        {
            
            // Configure API key authorization: Token
            Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");

            var apiInstance = new WebhooksApi();

            try
            {
                // Fetch a list of all webhooks.
                Webhooks result = apiInstance.GetWebhooks();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling WebhooksApi.GetWebhooks: " + e.Message );
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

Webhooks

Authorization

Token

HTTP request headers

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

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

PatchWebhook

Webhook PatchWebhook (string resourceId, List patchDelta)

Modify a webhook by ID.

Example

using System;
using System.Diagnostics;
using LaunchDarkly.Api.Api;
using LaunchDarkly.Api.Client;
using LaunchDarkly.Api.Model;

namespace Example
{
    public class PatchWebhookExample
    {
        public void main()
        {
            
            // Configure API key authorization: Token
            Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");

            var apiInstance = new WebhooksApi();
            var resourceId = resourceId_example;  // string | The resource ID.
            var patchDelta = new List<PatchOperation>(); // List<PatchOperation> | Requires a JSON Patch representation of the desired changes to the project. 'http://jsonpatch.com/'

            try
            {
                // Modify a webhook by ID.
                Webhook result = apiInstance.PatchWebhook(resourceId, patchDelta);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling WebhooksApi.PatchWebhook: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
resourceId string The resource ID.
patchDelta List 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

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

PostWebhook

Webhook PostWebhook (WebhookBody webhookBody)

Create a webhook.

Example

using System;
using System.Diagnostics;
using LaunchDarkly.Api.Api;
using LaunchDarkly.Api.Client;
using LaunchDarkly.Api.Model;

namespace Example
{
    public class PostWebhookExample
    {
        public void main()
        {
            
            // Configure API key authorization: Token
            Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");

            var apiInstance = new WebhooksApi();
            var webhookBody = new WebhookBody(); // WebhookBody | New webhook.

            try
            {
                // Create a webhook.
                Webhook result = apiInstance.PostWebhook(webhookBody);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling WebhooksApi.PostWebhook: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
webhookBody WebhookBody New webhook.

Return type

Webhook

Authorization

Token

HTTP request headers

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

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