Skip to content

Latest commit

 

History

History
512 lines (325 loc) · 14 KB

WebhooksApi.md

File metadata and controls

512 lines (325 loc) · 14 KB

\WebhooksApi

All URIs are relative to https://test-api.configcat.com

Method HTTP request Description
CreateWebhook Post /v1/configs/{configId}/environments/{environmentId}/webhooks Create Webhook
DeleteWebhook Delete /v1/webhooks/{webhookId} Delete Webhook
GetWebhook Get /v1/webhooks/{webhookId} Get Webhook
GetWebhookSigningKeys Get /v1/webhooks/{webhookId}/keys Get Webhook Signing Keys
GetWebhooks Get /v1/products/{productId}/webhooks List Webhooks
ReplaceWebhook Put /v1/webhooks/{webhookId} Replace Webhook
UpdateWebhook Patch /v1/webhooks/{webhookId} Update Webhook

CreateWebhook

WebhookModel CreateWebhook(ctx, configId, environmentId).WebHookRequest(webHookRequest).Execute()

Create Webhook

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/configcat/configcat-publicapi-go-client"
)

func main() {
    configId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | The identifier of the Config.
    environmentId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | The identifier of the Environment.
    webHookRequest := *openapiclient.NewWebHookRequest("Url_example") // WebHookRequest | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WebhooksApi.CreateWebhook(context.Background(), configId, environmentId).WebHookRequest(webHookRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WebhooksApi.CreateWebhook``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CreateWebhook`: WebhookModel
    fmt.Fprintf(os.Stdout, "Response from `WebhooksApi.CreateWebhook`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
configId string The identifier of the Config.
environmentId string The identifier of the Environment.

Other Parameters

Other parameters are passed through a pointer to a apiCreateWebhookRequest struct via the builder pattern

Name Type Description Notes

webHookRequest | WebHookRequest | |

Return type

WebhookModel

Authorization

Basic

HTTP request headers

  • Content-Type: application/json, text/json, application/*+json
  • Accept: application/json

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

DeleteWebhook

DeleteWebhook(ctx, webhookId).Execute()

Delete Webhook

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/configcat/configcat-publicapi-go-client"
)

func main() {
    webhookId := int32(56) // int32 | The identifier of the Webhook.

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    r, err := apiClient.WebhooksApi.DeleteWebhook(context.Background(), webhookId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WebhooksApi.DeleteWebhook``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
webhookId int32 The identifier of the Webhook.

Other Parameters

Other parameters are passed through a pointer to a apiDeleteWebhookRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

Basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

GetWebhook

WebhookModel GetWebhook(ctx, webhookId).Execute()

Get Webhook

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/configcat/configcat-publicapi-go-client"
)

func main() {
    webhookId := int32(56) // int32 | The identifier of the Webhook.

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WebhooksApi.GetWebhook(context.Background(), webhookId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WebhooksApi.GetWebhook``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetWebhook`: WebhookModel
    fmt.Fprintf(os.Stdout, "Response from `WebhooksApi.GetWebhook`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
webhookId int32 The identifier of the Webhook.

Other Parameters

Other parameters are passed through a pointer to a apiGetWebhookRequest struct via the builder pattern

Name Type Description Notes

Return type

WebhookModel

Authorization

Basic

HTTP request headers

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

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

GetWebhookSigningKeys

WebhookSigningKeysModel GetWebhookSigningKeys(ctx, webhookId).Execute()

Get Webhook Signing Keys

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/configcat/configcat-publicapi-go-client"
)

func main() {
    webhookId := int32(56) // int32 | The identifier of the Webhook.

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WebhooksApi.GetWebhookSigningKeys(context.Background(), webhookId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WebhooksApi.GetWebhookSigningKeys``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetWebhookSigningKeys`: WebhookSigningKeysModel
    fmt.Fprintf(os.Stdout, "Response from `WebhooksApi.GetWebhookSigningKeys`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
webhookId int32 The identifier of the Webhook.

Other Parameters

Other parameters are passed through a pointer to a apiGetWebhookSigningKeysRequest struct via the builder pattern

Name Type Description Notes

Return type

WebhookSigningKeysModel

Authorization

Basic

HTTP request headers

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

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

GetWebhooks

[]WebhookModel GetWebhooks(ctx, productId).Execute()

List Webhooks

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/configcat/configcat-publicapi-go-client"
)

func main() {
    productId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | The identifier of the Product.

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WebhooksApi.GetWebhooks(context.Background(), productId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WebhooksApi.GetWebhooks``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetWebhooks`: []WebhookModel
    fmt.Fprintf(os.Stdout, "Response from `WebhooksApi.GetWebhooks`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
productId string The identifier of the Product.

Other Parameters

Other parameters are passed through a pointer to a apiGetWebhooksRequest struct via the builder pattern

Name Type Description Notes

Return type

[]WebhookModel

Authorization

Basic

HTTP request headers

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

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

ReplaceWebhook

WebhookModel ReplaceWebhook(ctx, webhookId).WebHookRequest(webHookRequest).Execute()

Replace Webhook

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/configcat/configcat-publicapi-go-client"
)

func main() {
    webhookId := int32(56) // int32 | The identifier of the Webhook.
    webHookRequest := *openapiclient.NewWebHookRequest("Url_example") // WebHookRequest | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WebhooksApi.ReplaceWebhook(context.Background(), webhookId).WebHookRequest(webHookRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WebhooksApi.ReplaceWebhook``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ReplaceWebhook`: WebhookModel
    fmt.Fprintf(os.Stdout, "Response from `WebhooksApi.ReplaceWebhook`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
webhookId int32 The identifier of the Webhook.

Other Parameters

Other parameters are passed through a pointer to a apiReplaceWebhookRequest struct via the builder pattern

Name Type Description Notes

webHookRequest | WebHookRequest | |

Return type

WebhookModel

Authorization

Basic

HTTP request headers

  • Content-Type: application/json, text/json, application/*+json
  • Accept: application/json

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

UpdateWebhook

WebhookModel UpdateWebhook(ctx, webhookId).JsonPatchOperation(jsonPatchOperation).Execute()

Update Webhook

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/configcat/configcat-publicapi-go-client"
)

func main() {
    webhookId := int32(56) // int32 | The identifier of the Webhook.
    jsonPatchOperation := []openapiclient.JsonPatchOperation{*openapiclient.NewJsonPatchOperation(openapiclient.OperationType("unknown"), "Path_example")} // []JsonPatchOperation | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WebhooksApi.UpdateWebhook(context.Background(), webhookId).JsonPatchOperation(jsonPatchOperation).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WebhooksApi.UpdateWebhook``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UpdateWebhook`: WebhookModel
    fmt.Fprintf(os.Stdout, "Response from `WebhooksApi.UpdateWebhook`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
webhookId int32 The identifier of the Webhook.

Other Parameters

Other parameters are passed through a pointer to a apiUpdateWebhookRequest struct via the builder pattern

Name Type Description Notes

jsonPatchOperation | []JsonPatchOperation | |

Return type

WebhookModel

Authorization

Basic

HTTP request headers

  • Content-Type: application/json, text/json, application/*+json
  • Accept: application/json

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