All URIs are relative to https://api.configcat.com
| Method | HTTP request | Description |
|---|---|---|
| getSettingValueV2 | GET /v2/environments/{environmentId}/settings/{settingId}/value | Get value |
| getSettingValuesV2 | GET /v2/configs/{configId}/environments/{environmentId}/values | Get values |
| postSettingValuesV2 | POST /v2/configs/{configId}/environments/{environmentId}/values | Post values |
| replaceSettingValueV2 | PUT /v2/environments/{environmentId}/settings/{settingId}/value | Replace value |
| updateSettingValueV2 | PATCH /v2/environments/{environmentId}/settings/{settingId}/value | Update value |
SettingFormulaModel getSettingValueV2(environmentId, settingId)
Get value
This endpoint returns the value of a Feature Flag or Setting in a specified Environment identified by the `environmentId` parameter. The most important fields in the response are the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an ordered collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules here. The `percentageEvaluationAttribute` represents the custom User Object attribute that must be used for percentage evaluation of the Feature Flag or Setting.
// 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.FeatureFlagSettingValuesV2Api;
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");
FeatureFlagSettingValuesV2Api apiInstance = new FeatureFlagSettingValuesV2Api(defaultClient);
UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment.
Integer settingId = 56; // Integer | The id of the Setting.
try {
SettingFormulaModel result = apiInstance.getSettingValueV2(environmentId, settingId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FeatureFlagSettingValuesV2Api#getSettingValueV2");
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 |
|---|---|---|---|
| environmentId | UUID | The identifier of the Environment. | |
| settingId | Integer | The id of the Setting. |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | When everything is ok, the setting value data returned. | - |
| 400 | Bad request. | - |
| 404 | Not found. | - |
| 429 | Too many requests. In case of the request rate exceeds the rate limits. | - |
ConfigSettingFormulasModel getSettingValuesV2(configId, environmentId)
Get values
This endpoint returns all Feature Flag and Setting values of a Config identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. The most important fields in the response are the `defaultValue`, `targetingRules`. The `defaultValue` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting Rules, or when there are no additional rules to evaluate. The `targetingRules` represents the current Targeting Rule configuration of the actual Feature Flag or Setting in an ordered collection, which means the order of the returned rules is matching to the evaluation order. You can read more about these rules here. The `percentageEvaluationAttribute` represents the custom User Object attribute that must be used for percentage evaluation of the Feature Flag or Setting.
// 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.FeatureFlagSettingValuesV2Api;
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");
FeatureFlagSettingValuesV2Api apiInstance = new FeatureFlagSettingValuesV2Api(defaultClient);
UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config.
UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment.
try {
ConfigSettingFormulasModel result = apiInstance.getSettingValuesV2(configId, environmentId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FeatureFlagSettingValuesV2Api#getSettingValuesV2");
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. |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | When everything is ok, the setting values returned. | - |
| 400 | Bad request. | - |
| 404 | Not found. | - |
| 429 | Too many requests. In case of the request rate exceeds the rate limits. | - |
ConfigSettingFormulasModel postSettingValuesV2(configId, environmentId, updateEvaluationFormulasModel, reason, bypassApproval, latestVersionId)
Post values
This endpoint batch updates the Feature Flags and Settings of a Config identified by the `configId` parameter in a specified Environment identified by the `environmentId` parameter. Only those Feature Flags and Settings are updated which are part of the request, all the others are left untouched. Important: As this endpoint is doing a complete replace on those Feature Flags and Settings, which are set in the request. It's important to set every other field that you don't want to change in its original state. Not listing a field means that it will reset. For example: We have the following resource of a Feature Flag. ```json { "settingFormulas": [ { "defaultValue": { "boolValue": false }, "targetingRules": [ { "conditions": [ { "userCondition": { "comparisonAttribute": "Email", "comparator": "sensitiveTextEquals", "comparisonValue": { "stringValue": "test@example.com" } } } ], "percentageOptions": [], "value": { "boolValue": true } } ], "settingId": 1 } ] } ``` If we send a batch replace request body as below: ```json { "updateFormulas": [ { "defaultValue": { "boolValue": false }, "settingId": 1 } ] } ``` Then besides that the default value is set to `true`, all Targeting Rules of the related Feature Flag are deleted. So we get a response like this: ```json { "settingFormulas": [ { "defaultValue": { "boolValue": false }, "targetingRules": [], "setting": { "settingId": 1 } } ] } ```
// 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.FeatureFlagSettingValuesV2Api;
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");
FeatureFlagSettingValuesV2Api apiInstance = new FeatureFlagSettingValuesV2Api(defaultClient);
UUID configId = UUID.randomUUID(); // UUID | The identifier of the Config.
UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment.
UpdateEvaluationFormulasModel updateEvaluationFormulasModel = new UpdateEvaluationFormulasModel(); // UpdateEvaluationFormulasModel |
String reason = "reason_example"; // String | The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on.
Boolean bypassApproval = true; // Boolean | Whether to bypass the approval process and directly apply the change. This is only applicable for users with bypass approval permission.
UUID latestVersionId = UUID.randomUUID(); // UUID | Optional. The version identifier of the last change made to the Feature Flag or Setting in the Environment. It can be used to make sure concurrent updates are not overwriting each other. If provided and the version identifier does not match the current version, the update will be rejected with a 409 Conflict response. The latest version id can be acquired from the `LastVersionId` property of the response models.
try {
ConfigSettingFormulasModel result = apiInstance.postSettingValuesV2(configId, environmentId, updateEvaluationFormulasModel, reason, bypassApproval, latestVersionId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FeatureFlagSettingValuesV2Api#postSettingValuesV2");
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. | |
| updateEvaluationFormulasModel | UpdateEvaluationFormulasModel | ||
| reason | String | The reason note for the Audit Log if the Product's "Config changes require a reason" preference is turned on. | [optional] |
| bypassApproval | Boolean | Whether to bypass the approval process and directly apply the change. This is only applicable for users with bypass approval permission. | [optional] |
| latestVersionId | UUID | Optional. The version identifier of the last change made to the Feature Flag or Setting in the Environment. It can be used to make sure concurrent updates are not overwriting each other. If provided and the version identifier does not match the current version, the update will be rejected with a 409 Conflict response. The latest version id can be acquired from the `LastVersionId` property of the response models. | [optional] |
- Content-Type: application/json, text/json, application/*+json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | When everything is ok, the updated setting values returned. | - |
| 400 | Bad request. | - |
| 404 | Not found. | - |
| 429 | Too many requests. In case of the request rate exceeds the rate limits. | - |
SettingFormulaModel replaceSettingValueV2(environmentId, settingId, updateEvaluationFormulaModel, reason, bypassApproval, latestVersionId)
Replace value
This endpoint replaces the value and the Targeting Rules of a Feature Flag or Setting in a specified Environment identified by the <a target="_blank" rel="noopener noreferrer" href="https://app.configcat.com/sdkkey\">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. Important: As this endpoint is doing a complete replace, it's important to set every other field that you don't want to change to its original state. Not listing one means it will reset. For example: We have the following resource of a Feature Flag. ```json { "defaultValue": { "boolValue": false }, "targetingRules": [ { "conditions": [ { "userCondition": { "comparisonAttribute": "Email", "comparator": "sensitiveTextEquals", "comparisonValue": { "stringValue": "test@example.com" } } } ], "percentageOptions": [], "value": { "boolValue": true } } ] } ``` If we send a replace request body as below: ```json { "defaultValue": { "boolValue": true } } ``` Then besides that the default served value is set to `true`, all the Targeting Rules are deleted. So we get a response like this: ```json { "defaultValue": { "boolValue": true }, "targetingRules": [] } ```
// 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.FeatureFlagSettingValuesV2Api;
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");
FeatureFlagSettingValuesV2Api apiInstance = new FeatureFlagSettingValuesV2Api(defaultClient);
UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment.
Integer settingId = 56; // Integer | The id of the Setting.
UpdateEvaluationFormulaModel updateEvaluationFormulaModel = new UpdateEvaluationFormulaModel(); // UpdateEvaluationFormulaModel |
String reason = "reason_example"; // String | The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on.
Boolean bypassApproval = true; // Boolean | Whether to bypass the approval process and directly apply the change. This is only applicable for users with bypass approval permission.
UUID latestVersionId = UUID.randomUUID(); // UUID | Optional. The version identifier of the last change made to the Feature Flag or Setting in the Environment. It can be used to make sure concurrent updates are not overwriting each other. If provided and the version identifier does not match the current version, the update will be rejected with a 409 Conflict response. The latest version id can be acquired from the `LastVersionId` property of the response models.
try {
SettingFormulaModel result = apiInstance.replaceSettingValueV2(environmentId, settingId, updateEvaluationFormulaModel, reason, bypassApproval, latestVersionId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FeatureFlagSettingValuesV2Api#replaceSettingValueV2");
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 |
|---|---|---|---|
| environmentId | UUID | The identifier of the Environment. | |
| settingId | Integer | The id of the Setting. | |
| updateEvaluationFormulaModel | UpdateEvaluationFormulaModel | ||
| reason | String | The reason note for the Audit Log if the Product's "Config changes require a reason" preference is turned on. | [optional] |
| bypassApproval | Boolean | Whether to bypass the approval process and directly apply the change. This is only applicable for users with bypass approval permission. | [optional] |
| latestVersionId | UUID | Optional. The version identifier of the last change made to the Feature Flag or Setting in the Environment. It can be used to make sure concurrent updates are not overwriting each other. If provided and the version identifier does not match the current version, the update will be rejected with a 409 Conflict response. The latest version id can be acquired from the `LastVersionId` property of the response models. | [optional] |
- 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. | - |
SettingFormulaModel updateSettingValueV2(environmentId, settingId, jsonPatchOperation, reason, bypassApproval, latestVersionId)
Update value
This endpoint updates the value of a Feature Flag or Setting with a collection of JSON Patch operations in a specified Environment. Only the `defaultValue`, `targetingRules`, and `percentageEvaluationAttribute` fields are modifiable by this endpoint. 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. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting. For example: We have the following resource of a Feature Flag. ```json { "defaultValue": { "boolValue": false }, "targetingRules": [ { "conditions": [ { "userCondition": { "comparisonAttribute": "Email", "comparator": "sensitiveTextEquals", "comparisonValue": { "stringValue": "test@example.com" } } } ], "percentageOptions": [], "value": { "boolValue": true } } ] } ``` If we send an update request body as below: ```json [ { "op": "replace", "path": "/targetingRules/0/value/boolValue", "value": true } ] ``` Only the first Targeting Rule's `value` is going to be set to `false` and all the other fields are remaining unchanged. So we get a response like this: ```json { "defaultValue": { "boolValue": false }, "targetingRules": [ { "conditions": [ { "userCondition": { "comparisonAttribute": "Email", "comparator": "sensitiveTextEquals", "comparisonValue": { "stringValue": "test@example.com" } } } ], "percentageOptions": [], "value": { "boolValue": 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.FeatureFlagSettingValuesV2Api;
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");
FeatureFlagSettingValuesV2Api apiInstance = new FeatureFlagSettingValuesV2Api(defaultClient);
UUID environmentId = UUID.randomUUID(); // UUID | The identifier of the Environment.
Integer settingId = 56; // Integer | The id of the Setting.
List<JsonPatchOperation> jsonPatchOperation = Arrays.asList(); // List<JsonPatchOperation> |
String reason = "reason_example"; // String | The reason note for the Audit Log if the Product's \"Config changes require a reason\" preference is turned on.
Boolean bypassApproval = true; // Boolean | Whether to bypass the approval process and directly apply the change. This is only applicable for users with bypass approval permission.
UUID latestVersionId = UUID.randomUUID(); // UUID | Optional. The version identifier of the last change made to the Feature Flag or Setting in the Environment. It can be used to make sure concurrent updates are not overwriting each other. If provided and the version identifier does not match the current version, the update will be rejected with a 409 Conflict response. The latest version id can be acquired from the `LastVersionId` property of the response models.
try {
SettingFormulaModel result = apiInstance.updateSettingValueV2(environmentId, settingId, jsonPatchOperation, reason, bypassApproval, latestVersionId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FeatureFlagSettingValuesV2Api#updateSettingValueV2");
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 |
|---|---|---|---|
| environmentId | UUID | The identifier of the Environment. | |
| settingId | Integer | The id of the Setting. | |
| jsonPatchOperation | List<JsonPatchOperation> | ||
| reason | String | The reason note for the Audit Log if the Product's "Config changes require a reason" preference is turned on. | [optional] |
| bypassApproval | Boolean | Whether to bypass the approval process and directly apply the change. This is only applicable for users with bypass approval permission. | [optional] |
| latestVersionId | UUID | Optional. The version identifier of the last change made to the Feature Flag or Setting in the Environment. It can be used to make sure concurrent updates are not overwriting each other. If provided and the version identifier does not match the current version, the update will be rejected with a 409 Conflict response. The latest version id can be acquired from the `LastVersionId` property of the response models. | [optional] |
- Content-Type: application/json, text/json, application/*+json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | When the patch was successful. | - |
| 204 | When no change applied on the resource. | - |
| 400 | Bad request. | - |
| 404 | Not found. | - |
| 429 | Too many requests. In case of the request rate exceeds the rate limits. | - |