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 |
WebhookModel CreateWebhook(ctx, configId, environmentId).WebHookRequest(webHookRequest).Execute()
Create Webhook
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)
}
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 are passed through a pointer to a apiCreateWebhookRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
webHookRequest | WebHookRequest | |
- 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(ctx, webhookId).Execute()
Delete Webhook
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)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
webhookId | int32 | The identifier of the Webhook. |
Other parameters are passed through a pointer to a apiDeleteWebhookRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WebhookModel GetWebhook(ctx, webhookId).Execute()
Get Webhook
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)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
webhookId | int32 | The identifier of the Webhook. |
Other parameters are passed through a pointer to a apiGetWebhookRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WebhookSigningKeysModel GetWebhookSigningKeys(ctx, webhookId).Execute()
Get Webhook Signing Keys
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)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
webhookId | int32 | The identifier of the Webhook. |
Other parameters are passed through a pointer to a apiGetWebhookSigningKeysRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]WebhookModel GetWebhooks(ctx, productId).Execute()
List Webhooks
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)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
productId | string | The identifier of the Product. |
Other parameters are passed through a pointer to a apiGetWebhooksRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WebhookModel ReplaceWebhook(ctx, webhookId).WebHookRequest(webHookRequest).Execute()
Replace Webhook
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)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
webhookId | int32 | The identifier of the Webhook. |
Other parameters are passed through a pointer to a apiReplaceWebhookRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
webHookRequest | WebHookRequest | |
- 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]
WebhookModel UpdateWebhook(ctx, webhookId).JsonPatchOperation(jsonPatchOperation).Execute()
Update Webhook
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)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
webhookId | int32 | The identifier of the Webhook. |
Other parameters are passed through a pointer to a apiUpdateWebhookRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
jsonPatchOperation | []JsonPatchOperation | |
- 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]