All URIs are relative to https://api.configcat.com
| Method | HTTP request | Description |
|---|---|---|
| getSettingValueBySdkkey | GET /v1/settings/{settingKeyOrId}/value | Get value |
| replaceSettingValueBySdkkey | PUT /v1/settings/{settingKeyOrId}/value | Replace value |
| updateSettingValueBySdkkey | PATCH /v1/settings/{settingKeyOrId}/value | Update value |
SettingValueModel getSettingValueBySdkkey(settingKeyOrId, X_CONFIGCAT_SDKKEY)
Get value
This endpoint returns the value 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. The most important attributes in the response are the `value`, `rolloutRules` and `percentageRules`. The `value` represents what the clients will get when the evaluation requests of our SDKs are not matching to any of the defined Targeting or Percentage Rules, or when there are no additional rules to evaluate. The `rolloutRules` and `percentageRules` attributes are representing the current Targeting and Percentage Rules 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.
// 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.FeatureFlagSettingValuesUsingSdkKeyApi;
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");
FeatureFlagSettingValuesUsingSdkKeyApi apiInstance = new FeatureFlagSettingValuesUsingSdkKeyApi(defaultClient);
String settingKeyOrId = "settingKeyOrId_example"; // String | The key or id of the Setting.
String X_CONFIGCAT_SDKKEY = "X_CONFIGCAT_SDKKEY_example"; // String | The ConfigCat SDK Key. (https://app.configcat.com/sdkkey)
try {
SettingValueModel result = apiInstance.getSettingValueBySdkkey(settingKeyOrId, X_CONFIGCAT_SDKKEY);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FeatureFlagSettingValuesUsingSdkKeyApi#getSettingValueBySdkkey");
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 |
|---|---|---|---|
| settingKeyOrId | String | The key or id of the Setting. | |
| X_CONFIGCAT_SDKKEY | String | The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) | [optional] |
- 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. | - |
SettingValueModel replaceSettingValueBySdkkey(settingKeyOrId, updateSettingValueModel, reason, X_CONFIGCAT_SDKKEY)
Replace value
This endpoint replaces the value 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 `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint. Important: As this endpoint is doing a complete replace, it's important to set every other attribute 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. ```json { "rolloutPercentageItems": [ { "percentage": 30, "value": true }, { "percentage": 70, "value": false } ], "rolloutRules": [], "value": false } ``` If we send a replace request body as below: ```json { "value": true } ``` Then besides that the default served value is set to `true`, all the Percentage Rules are deleted. So we get a response like this: ```json { "rolloutPercentageItems": [], "rolloutRules": [], "value": true } ```
// 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.FeatureFlagSettingValuesUsingSdkKeyApi;
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");
FeatureFlagSettingValuesUsingSdkKeyApi apiInstance = new FeatureFlagSettingValuesUsingSdkKeyApi(defaultClient);
String settingKeyOrId = "settingKeyOrId_example"; // String | The key or id of the Setting.
UpdateSettingValueModel updateSettingValueModel = new UpdateSettingValueModel(); // UpdateSettingValueModel |
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.
String X_CONFIGCAT_SDKKEY = "X_CONFIGCAT_SDKKEY_example"; // String | The ConfigCat SDK Key. (https://app.configcat.com/sdkkey)
try {
SettingValueModel result = apiInstance.replaceSettingValueBySdkkey(settingKeyOrId, updateSettingValueModel, reason, X_CONFIGCAT_SDKKEY);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FeatureFlagSettingValuesUsingSdkKeyApi#replaceSettingValueBySdkkey");
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 |
|---|---|---|---|
| settingKeyOrId | String | The key or id of the Setting. | |
| updateSettingValueModel | UpdateSettingValueModel | ||
| reason | String | The reason note for the Audit Log if the Product's "Config changes require a reason" preference is turned on. | [optional] |
| X_CONFIGCAT_SDKKEY | String | The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) | [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. | - |
SettingValueModel updateSettingValueBySdkkey(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY)
Update value
This endpoint updates the value of a Feature Flag or Setting with a collection of JSON Patch operations 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 `value`, `rolloutRules` and `percentageRules` attributes 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. ```json { "rolloutPercentageItems": [ { "percentage": 30, "value": true }, { "percentage": 70, "value": false } ], "rolloutRules": [], "value": false } ``` If we send an update request body as below: ```json [ { "op": "replace", "path": "/value", "value": true } ] ``` Only the default served value is going to be set to `true` and all the Percentage Rules are remaining unchanged. So we get a response like this: ```json { "rolloutPercentageItems": [ { "percentage": 30, "value": true }, { "percentage": 70, "value": false } ], "rolloutRules": [], "value": true } ```
// 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.FeatureFlagSettingValuesUsingSdkKeyApi;
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");
FeatureFlagSettingValuesUsingSdkKeyApi apiInstance = new FeatureFlagSettingValuesUsingSdkKeyApi(defaultClient);
String settingKeyOrId = "settingKeyOrId_example"; // String | The key or 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.
String X_CONFIGCAT_SDKKEY = "X_CONFIGCAT_SDKKEY_example"; // String | The ConfigCat SDK Key. (https://app.configcat.com/sdkkey)
try {
SettingValueModel result = apiInstance.updateSettingValueBySdkkey(settingKeyOrId, jsonPatchOperation, reason, X_CONFIGCAT_SDKKEY);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FeatureFlagSettingValuesUsingSdkKeyApi#updateSettingValueBySdkkey");
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 |
|---|---|---|---|
| settingKeyOrId | String | The key or 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] |
| X_CONFIGCAT_SDKKEY | String | The ConfigCat SDK Key. (https://app.configcat.com/sdkkey) | [optional] |
- Content-Type: application/json, text/json, application/*+json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | - | |
| 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. | - |