All URIs are relative to https://api.configcat.com
Method | HTTP request | Description |
---|---|---|
createConfig | POST /v1/products/{productId}/configs | Create Config |
deleteConfig | DELETE /v1/configs/{configId} | Delete Config |
getConfig | GET /v1/configs/{configId} | Get Config |
getConfigs | GET /v1/products/{productId}/configs | List Configs |
updateConfig | PUT /v1/configs/{configId} | Update Config |
ConfigModel createConfig(productId, createConfigRequest)
Create Config
This endpoint creates a new Config 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.ConfigsApi;
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");
ConfigsApi apiInstance = new ConfigsApi(defaultClient);
UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product.
CreateConfigRequest createConfigRequest = new CreateConfigRequest(); // CreateConfigRequest |
try {
ConfigModel result = apiInstance.createConfig(productId, createConfigRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ConfigsApi#createConfig");
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. | |
createConfigRequest | CreateConfigRequest |
- 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. | - |
deleteConfig(configId)
Delete Config
This endpoint removes a Config identified by the `configId` 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.ConfigsApi;
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");
ConfigsApi apiInstance = new ConfigsApi(defaultClient);
UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config.
try {
apiInstance.deleteConfig(configId);
} catch (ApiException e) {
System.err.println("Exception when calling ConfigsApi#deleteConfig");
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. |
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. | - |
ConfigModel getConfig(configId)
Get Config
This endpoint returns the metadata of a Config identified by the `configId`.
// 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.ConfigsApi;
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");
ConfigsApi apiInstance = new ConfigsApi(defaultClient);
UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config.
try {
ConfigModel result = apiInstance.getConfig(configId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ConfigsApi#getConfig");
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. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | When everything is ok, the config data returned. | - |
400 | Bad request. | - |
404 | Not found. | - |
429 | Too many requests. In case of the request rate exceeds the rate limits. | - |
List<ConfigModel> getConfigs(productId)
List Configs
This endpoint returns the list of the Configs 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.ConfigsApi;
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");
ConfigsApi apiInstance = new ConfigsApi(defaultClient);
UUID productId = UUID.randomUUID(); // UUID | The identifier of the Product.
try {
List<ConfigModel> result = apiInstance.getConfigs(productId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ConfigsApi#getConfigs");
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 | - | |
400 | Bad request. | - |
404 | Not found. | - |
429 | Too many requests. In case of the request rate exceeds the rate limits. | - |
ConfigModel updateConfig(configId, updateConfigRequest)
Update Config
This endpoint updates a Config identified by the `configId` 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.ConfigsApi;
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");
ConfigsApi apiInstance = new ConfigsApi(defaultClient);
UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config.
UpdateConfigRequest updateConfigRequest = new UpdateConfigRequest(); // UpdateConfigRequest |
try {
ConfigModel result = apiInstance.updateConfig(configId, updateConfigRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ConfigsApi#updateConfig");
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. | |
updateConfigRequest | UpdateConfigRequest |
- Content-Type: application/json, text/json, application/*+json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | - | |
400 | Bad request. | - |
404 | Not found. | - |
429 | Too many requests. In case of the request rate exceeds the rate limits. | - |