All URIs are relative to https://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(configId, environmentId, webHookRequest)
Create Webhook
This endpoint creates a new Webhook in a specified Product identified by the `productId` parameter, which can be obtained from the List Products endpoint.
// Import classes:
import com.configcat.publicapi.java.client.ApiClient;
import com.configcat.publicapi.java.client.ApiException;
import com.configcat.publicapi.java.client.Configuration;
import com.configcat.publicapi.java.client.auth.*;
import com.configcat.publicapi.java.client.models.*;
import com.configcat.publicapi.java.client.api.WebhooksApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.configcat.com");
// Configure HTTP basic authorization: Basic
HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
Basic.setUsername("YOUR USERNAME");
Basic.setPassword("YOUR PASSWORD");
WebhooksApi apiInstance = new WebhooksApi(defaultClient);
UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config.
UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment.
WebHookRequest webHookRequest = new WebHookRequest(); // WebHookRequest |
try {
WebhookModel result = apiInstance.createWebhook(configId, environmentId, webHookRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling WebhooksApi#createWebhook");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
configId | UUID | The identifier of the Config. | |
environmentId | UUID | The identifier of the Environment. | |
webHookRequest | WebHookRequest |
- Content-Type: application/json, text/json, application/*+json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | When the creation was successful. | - |
400 | Bad request. | - |
404 | Not found. | - |
429 | Too many requests. In case of the request rate exceeds the rate limits. | - |
deleteWebhook(webhookId)
Delete Webhook
This endpoint removes a Webhook identified by the `webhookId` parameter.
// Import classes:
import com.configcat.publicapi.java.client.ApiClient;
import com.configcat.publicapi.java.client.ApiException;
import com.configcat.publicapi.java.client.Configuration;
import com.configcat.publicapi.java.client.auth.*;
import com.configcat.publicapi.java.client.models.*;
import com.configcat.publicapi.java.client.api.WebhooksApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.configcat.com");
// Configure HTTP basic authorization: Basic
HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
Basic.setUsername("YOUR USERNAME");
Basic.setPassword("YOUR PASSWORD");
WebhooksApi apiInstance = new WebhooksApi(defaultClient);
Integer webhookId = 56; // Integer | The identifier of the Webhook.
try {
apiInstance.deleteWebhook(webhookId);
} catch (ApiException e) {
System.err.println("Exception when calling WebhooksApi#deleteWebhook");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
webhookId | Integer | The identifier of the Webhook. |
null (empty response body)
- Content-Type: Not defined
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
204 | When the delete was successful. | - |
400 | Bad request. | - |
404 | Not found. | - |
429 | Too many requests. In case of the request rate exceeds the rate limits. | - |
WebhookModel getWebhook(webhookId)
Get Webhook
This endpoint returns the metadata of a Webhook identified by the `webhookId`.
// Import classes:
import com.configcat.publicapi.java.client.ApiClient;
import com.configcat.publicapi.java.client.ApiException;
import com.configcat.publicapi.java.client.Configuration;
import com.configcat.publicapi.java.client.auth.*;
import com.configcat.publicapi.java.client.models.*;
import com.configcat.publicapi.java.client.api.WebhooksApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.configcat.com");
// Configure HTTP basic authorization: Basic
HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
Basic.setUsername("YOUR USERNAME");
Basic.setPassword("YOUR PASSWORD");
WebhooksApi apiInstance = new WebhooksApi(defaultClient);
Integer webhookId = 56; // Integer | The identifier of the Webhook.
try {
WebhookModel result = apiInstance.getWebhook(webhookId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling WebhooksApi#getWebhook");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
webhookId | Integer | The identifier of the Webhook. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | When everything is ok, the webhook data is returned. | - |
400 | Bad request. | - |
404 | Not found. | - |
429 | Too many requests. In case of the request rate exceeds the rate limits. | - |
WebhookSigningKeysModel getWebhookSigningKeys(webhookId)
Get Webhook Signing Keys
This endpoint returns the signing keys of a Webhook identified by the `webhookId`. Signing keys are used for ensuring the Webhook requests you receive are actually sent by ConfigCat. <a href="https://configcat.com/docs/advanced/notifications-webhooks/#verifying-webhook-requests\" target="_blank" rel="noopener noreferrer">Here</a> you can read more about Webhook request verification.
// Import classes:
import com.configcat.publicapi.java.client.ApiClient;
import com.configcat.publicapi.java.client.ApiException;
import com.configcat.publicapi.java.client.Configuration;
import com.configcat.publicapi.java.client.auth.*;
import com.configcat.publicapi.java.client.models.*;
import com.configcat.publicapi.java.client.api.WebhooksApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.configcat.com");
// Configure HTTP basic authorization: Basic
HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
Basic.setUsername("YOUR USERNAME");
Basic.setPassword("YOUR PASSWORD");
WebhooksApi apiInstance = new WebhooksApi(defaultClient);
Integer webhookId = 56; // Integer | The identifier of the Webhook.
try {
WebhookSigningKeysModel result = apiInstance.getWebhookSigningKeys(webhookId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling WebhooksApi#getWebhookSigningKeys");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
webhookId | Integer | The identifier of the Webhook. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | When everything is ok, the webhook signing keys are returned. | - |
400 | Bad request. | - |
404 | Not found. | - |
429 | Too many requests. In case of the request rate exceeds the rate limits. | - |
List<WebhookModel> getWebhooks(productId)
List Webhooks
This endpoint returns the list of the Webhooks that belongs to the given Product identified by the `productId` parameter, which can be obtained from the List Products endpoint.
// Import classes:
import com.configcat.publicapi.java.client.ApiClient;
import com.configcat.publicapi.java.client.ApiException;
import com.configcat.publicapi.java.client.Configuration;
import com.configcat.publicapi.java.client.auth.*;
import com.configcat.publicapi.java.client.models.*;
import com.configcat.publicapi.java.client.api.WebhooksApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.configcat.com");
// Configure HTTP basic authorization: Basic
HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
Basic.setUsername("YOUR USERNAME");
Basic.setPassword("YOUR PASSWORD");
WebhooksApi apiInstance = new WebhooksApi(defaultClient);
UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product.
try {
List<WebhookModel> result = apiInstance.getWebhooks(productId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling WebhooksApi#getWebhooks");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
productId | UUID | The identifier of the Product. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | - | |
429 | Too many requests. In case of the request rate exceeds the rate limits. | - |
WebhookModel replaceWebhook(webhookId, webHookRequest)
Replace Webhook
This endpoint replaces the whole value of a Webhook identified by the `webhookId` parameter. Important: As this endpoint is doing a complete replace, it's important to set every other attribute that you don't want to change in its original state. Not listing one means it will reset.
// Import classes:
import com.configcat.publicapi.java.client.ApiClient;
import com.configcat.publicapi.java.client.ApiException;
import com.configcat.publicapi.java.client.Configuration;
import com.configcat.publicapi.java.client.auth.*;
import com.configcat.publicapi.java.client.models.*;
import com.configcat.publicapi.java.client.api.WebhooksApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.configcat.com");
// Configure HTTP basic authorization: Basic
HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
Basic.setUsername("YOUR USERNAME");
Basic.setPassword("YOUR PASSWORD");
WebhooksApi apiInstance = new WebhooksApi(defaultClient);
Integer webhookId = 56; // Integer | The identifier of the Webhook.
WebHookRequest webHookRequest = new WebHookRequest(); // WebHookRequest |
try {
WebhookModel result = apiInstance.replaceWebhook(webhookId, webHookRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling WebhooksApi#replaceWebhook");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
webhookId | Integer | The identifier of the Webhook. | |
webHookRequest | WebHookRequest |
- Content-Type: application/json, text/json, application/*+json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | When the replace was successful. | - |
400 | Bad request. | - |
404 | Not found. | - |
429 | Too many requests. In case of the request rate exceeds the rate limits. | - |
WebhookModel updateWebhook(webhookId, jsonPatchOperation)
Update Webhook
This endpoint updates a Webhook identified by the `webhookId` parameter with a collection of JSON Patch operations. The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. For example: We have the following resource. ```json { "webhookId": 6, "url": "https://example.com/hook\", "httpMethod": "post", "content": "null", "webHookHeaders": [] } ``` If we send an update request body as below (it changes the `content` field and adds a new HTTP header): ```json [ { "op": "replace", "path": "/content", "value": "Some webhook content." }, { "op": "add", "path": "/webHookHeaders/-", "value": { "key": "X-Custom-Header", "value": "Custom header value" } } ] ``` Only the `content` and `webHookHeaders` are updated and all the other attributes remain unchanged. So we get a response like this: ```json { "webhookId": 6, "url": "https://example.com/hook\", "httpMethod": "post", "content": "Some webhook content.", "webHookHeaders": [ { "key": "X-Custom-Header", "value": "Custom header value", "isSecure": false } ] } ```
// Import classes:
import com.configcat.publicapi.java.client.ApiClient;
import com.configcat.publicapi.java.client.ApiException;
import com.configcat.publicapi.java.client.Configuration;
import com.configcat.publicapi.java.client.auth.*;
import com.configcat.publicapi.java.client.models.*;
import com.configcat.publicapi.java.client.api.WebhooksApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.configcat.com");
// Configure HTTP basic authorization: Basic
HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
Basic.setUsername("YOUR USERNAME");
Basic.setPassword("YOUR PASSWORD");
WebhooksApi apiInstance = new WebhooksApi(defaultClient);
Integer webhookId = 56; // Integer | The identifier of the Webhook.
List<JsonPatchOperation> jsonPatchOperation = Arrays.asList(); // List<JsonPatchOperation> |
try {
WebhookModel result = apiInstance.updateWebhook(webhookId, jsonPatchOperation);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling WebhooksApi#updateWebhook");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
webhookId | Integer | The identifier of the Webhook. | |
jsonPatchOperation | List<JsonPatchOperation> |
- Content-Type: application/json, text/json, application/*+json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | When the update was successful. | - |
400 | Bad request. | - |
404 | Not found. | - |
429 | Too many requests. In case of the request rate exceeds the rate limits. | - |