Skip to content

Latest commit

 

History

History
1031 lines (819 loc) · 43.8 KB

ApprovalsApi.md

File metadata and controls

1031 lines (819 loc) · 43.8 KB

ApprovalsApi

All URIs are relative to https://app.launchdarkly.com

Method HTTP request Description
deleteApprovalRequest DELETE /api/v2/approval-requests/{id} Delete approval request
deleteApprovalRequestForFlag DELETE /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id} Delete approval request for a flag
getApprovalForFlag GET /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id} Get approval request for a flag
getApprovalRequest GET /api/v2/approval-requests/{id} Get approval request
getApprovalRequests GET /api/v2/approval-requests List approval requests
getApprovalsForFlag GET /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests List approval requests for a flag
postApprovalRequest POST /api/v2/approval-requests Create approval request
postApprovalRequestApply POST /api/v2/approval-requests/{id}/apply Apply approval request
postApprovalRequestApplyForFlag POST /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}/apply Apply approval request for a flag
postApprovalRequestForFlag POST /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests Create approval request for a flag
postApprovalRequestReview POST /api/v2/approval-requests/{id}/reviews Review approval request
postApprovalRequestReviewForFlag POST /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}/reviews Review approval request for a flag
postFlagCopyConfigApprovalRequest POST /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests-flag-copy Create approval request to copy flag configurations across environments

deleteApprovalRequest

deleteApprovalRequest(id)

Delete approval request

Delete an approval request.

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ApprovalsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ApprovalsApi apiInstance = new ApprovalsApi(defaultClient);
    String id = "id_example"; // String | The approval request ID
    try {
      apiInstance.deleteApprovalRequest(id);
    } catch (ApiException e) {
      System.err.println("Exception when calling ApprovalsApi#deleteApprovalRequest");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
id String The approval request ID

Return type

null (empty response body)

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 Action succeeded -
401 Invalid access token -
403 Forbidden -
404 Invalid resource identifier -
429 Rate limited -

deleteApprovalRequestForFlag

deleteApprovalRequestForFlag(projectKey, featureFlagKey, environmentKey, id)

Delete approval request for a flag

Delete an approval request for a feature flag.

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ApprovalsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ApprovalsApi apiInstance = new ApprovalsApi(defaultClient);
    String projectKey = "projectKey_example"; // String | The project key
    String featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
    String environmentKey = "environmentKey_example"; // String | The environment key
    String id = "id_example"; // String | The feature flag approval request ID
    try {
      apiInstance.deleteApprovalRequestForFlag(projectKey, featureFlagKey, environmentKey, id);
    } catch (ApiException e) {
      System.err.println("Exception when calling ApprovalsApi#deleteApprovalRequestForFlag");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
projectKey String The project key
featureFlagKey String The feature flag key
environmentKey String The environment key
id String The feature flag approval request ID

Return type

null (empty response body)

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 Action succeeded -
401 Invalid access token -
403 Forbidden -
404 Invalid resource identifier -
429 Rate limited -

getApprovalForFlag

FlagConfigApprovalRequestResponse getApprovalForFlag(projectKey, featureFlagKey, environmentKey, id)

Get approval request for a flag

Get a single approval request for a feature flag.

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ApprovalsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ApprovalsApi apiInstance = new ApprovalsApi(defaultClient);
    String projectKey = "projectKey_example"; // String | The project key
    String featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
    String environmentKey = "environmentKey_example"; // String | The environment key
    String id = "id_example"; // String | The feature flag approval request ID
    try {
      FlagConfigApprovalRequestResponse result = apiInstance.getApprovalForFlag(projectKey, featureFlagKey, environmentKey, id);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ApprovalsApi#getApprovalForFlag");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
projectKey String The project key
featureFlagKey String The feature flag key
environmentKey String The environment key
id String The feature flag approval request ID

Return type

FlagConfigApprovalRequestResponse

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Approval request response -
401 Invalid access token -
403 Forbidden -
404 Invalid resource identifier -
429 Rate limited -

getApprovalRequest

ExpandableApprovalRequestResponse getApprovalRequest(id, expand)

Get approval request

Get an approval request by approval request ID. ### Expanding approval response LaunchDarkly supports the `expand` query param to include additional fields in the response, with the following fields: - `environments` includes the environments the approval request relates to - `flag` includes the flag the approval request belongs to - `project` includes the project the approval request belongs to - `resource` includes details on the resource (flag or segment) the approval request relates to For example, `expand=project,flag` includes the `project` and `flag` fields in the response.

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ApprovalsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ApprovalsApi apiInstance = new ApprovalsApi(defaultClient);
    String id = "id_example"; // String | The approval request ID
    String expand = "expand_example"; // String | A comma-separated list of fields to expand in the response. Supported fields are explained above.
    try {
      ExpandableApprovalRequestResponse result = apiInstance.getApprovalRequest(id, expand);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ApprovalsApi#getApprovalRequest");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
id String The approval request ID
expand String A comma-separated list of fields to expand in the response. Supported fields are explained above. [optional]

Return type

ExpandableApprovalRequestResponse

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Approval request response -
400 Invalid Request -
401 Invalid access token -
403 Forbidden -
404 Unable to find approval request -
429 Rate limited -

getApprovalRequests

ExpandableApprovalRequestsResponse getApprovalRequests(filter, expand, limit, offset)

List approval requests

Get all approval requests. ### Filtering approvals LaunchDarkly supports the `filter` query param for filtering, with the following fields: - `notifyMemberIds` filters for only approvals that are assigned to a member in the specified list. For example: `filter=notifyMemberIds anyOf ["memberId1", "memberId2"]`. - `requestorId` filters for only approvals that correspond to the ID of the member who requested the approval. For example: `filter=requestorId equals 457034721476302714390214`. - `resourceId` filters for only approvals that correspond to the the specified resource identifier. For example: `filter=resourceId equals proj/my-project:env/my-environment:flag/my-flag`. - `resourceKind` filters for only approvals that correspond to the specified resource kind. For example: `filter=resourceKind equals flag`. Currently, `flag` and `segment` resource kinds are supported. - `reviewStatus` filters for only approvals which correspond to the review status in the specified list. The possible values are `approved`, `declined`, and `pending`. For example: `filter=reviewStatus anyOf ["pending", "approved"]`. - `status` filters for only approvals which correspond to the status in the specified list. The possible values are `pending`, `scheduled`, `failed`, and `completed`. For example: `filter=status anyOf ["pending", "scheduled"]`. You can also apply multiple filters at once. For example, setting `filter=projectKey equals my-project, reviewStatus anyOf ["pending","approved"]` matches approval requests which correspond to the `my-project` project key, and a review status of either `pending` or `approved`. ### Expanding approval response LaunchDarkly supports the `expand` query param to include additional fields in the response, with the following fields: - `flag` includes the flag the approval request belongs to - `project` includes the project the approval request belongs to - `environments` includes the environments the approval request relates to For example, `expand=project,flag` includes the `project` and `flag` fields in the response.

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ApprovalsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ApprovalsApi apiInstance = new ApprovalsApi(defaultClient);
    String filter = "filter_example"; // String | A comma-separated list of filters. Each filter is of the form `field operator value`. Supported fields are explained above.
    String expand = "expand_example"; // String | A comma-separated list of fields to expand in the response. Supported fields are explained above.
    Long limit = 56L; // Long | The number of approvals to return. Defaults to 20. Maximum limit is 200.
    Long offset = 56L; // Long | Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.
    try {
      ExpandableApprovalRequestsResponse result = apiInstance.getApprovalRequests(filter, expand, limit, offset);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ApprovalsApi#getApprovalRequests");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
filter String A comma-separated list of filters. Each filter is of the form `field operator value`. Supported fields are explained above. [optional]
expand String A comma-separated list of fields to expand in the response. Supported fields are explained above. [optional]
limit Long The number of approvals to return. Defaults to 20. Maximum limit is 200. [optional]
offset Long Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. [optional]

Return type

ExpandableApprovalRequestsResponse

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Approval request collection response -
400 Unsupported filter field. Filter field must be one of: requestorId, projectKey, notifyMemberIds, reviewStatus, or status -
401 Invalid access token -
403 Forbidden -
429 Rate limited -

getApprovalsForFlag

FlagConfigApprovalRequestsResponse getApprovalsForFlag(projectKey, featureFlagKey, environmentKey)

List approval requests for a flag

Get all approval requests for a feature flag.

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ApprovalsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ApprovalsApi apiInstance = new ApprovalsApi(defaultClient);
    String projectKey = "projectKey_example"; // String | The project key
    String featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
    String environmentKey = "environmentKey_example"; // String | The environment key
    try {
      FlagConfigApprovalRequestsResponse result = apiInstance.getApprovalsForFlag(projectKey, featureFlagKey, environmentKey);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ApprovalsApi#getApprovalsForFlag");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
projectKey String The project key
featureFlagKey String The feature flag key
environmentKey String The environment key

Return type

FlagConfigApprovalRequestsResponse

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Approval request collection response -
401 Invalid access token -
403 Forbidden -
404 Invalid resource identifier -
429 Rate limited -

postApprovalRequest

ApprovalRequestResponse postApprovalRequest(createApprovalRequestRequest)

Create approval request

Create an approval request. This endpoint requires a list of `instructions`, in semantic patch format, that will be applied when the approval request is approved and applied. If you are creating an approval request for a flag, you can use the following `instructions`: - `addVariation` - `removeVariation` - `updateVariation` - `updateDefaultVariation` For details on using these instructions, read Update feature flag. To create an approval for a flag specific to an environment, use Create approval request for a flag. If you are creating an approval request for a segment, you can use the following read Patch segment for details on the available `instructions`.

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ApprovalsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ApprovalsApi apiInstance = new ApprovalsApi(defaultClient);
    CreateApprovalRequestRequest createApprovalRequestRequest = new CreateApprovalRequestRequest(); // CreateApprovalRequestRequest | 
    try {
      ApprovalRequestResponse result = apiInstance.postApprovalRequest(createApprovalRequestRequest);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ApprovalsApi#postApprovalRequest");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
createApprovalRequestRequest CreateApprovalRequestRequest

Return type

ApprovalRequestResponse

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Approval request response -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
429 Rate limited -

postApprovalRequestApply

ApprovalRequestResponse postApprovalRequestApply(id, postApprovalRequestApplyRequest)

Apply approval request

Apply an approval request that has been approved. This endpoint works with approval requests for either flag or segment changes.

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ApprovalsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ApprovalsApi apiInstance = new ApprovalsApi(defaultClient);
    String id = "id_example"; // String | The approval request ID
    PostApprovalRequestApplyRequest postApprovalRequestApplyRequest = new PostApprovalRequestApplyRequest(); // PostApprovalRequestApplyRequest | 
    try {
      ApprovalRequestResponse result = apiInstance.postApprovalRequestApply(id, postApprovalRequestApplyRequest);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ApprovalsApi#postApprovalRequestApply");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
id String The approval request ID
postApprovalRequestApplyRequest PostApprovalRequestApplyRequest

Return type

ApprovalRequestResponse

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Approval request apply response -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
404 Invalid resource identifier -
429 Rate limited -

postApprovalRequestApplyForFlag

FlagConfigApprovalRequestResponse postApprovalRequestApplyForFlag(projectKey, featureFlagKey, environmentKey, id, postApprovalRequestApplyRequest)

Apply approval request for a flag

Apply an approval request that has been approved. This endpoint requires a feature flag key, and can only be used for applying approval requests on flags.

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ApprovalsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ApprovalsApi apiInstance = new ApprovalsApi(defaultClient);
    String projectKey = "projectKey_example"; // String | The project key
    String featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
    String environmentKey = "environmentKey_example"; // String | The environment key
    String id = "id_example"; // String | The feature flag approval request ID
    PostApprovalRequestApplyRequest postApprovalRequestApplyRequest = new PostApprovalRequestApplyRequest(); // PostApprovalRequestApplyRequest | 
    try {
      FlagConfigApprovalRequestResponse result = apiInstance.postApprovalRequestApplyForFlag(projectKey, featureFlagKey, environmentKey, id, postApprovalRequestApplyRequest);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ApprovalsApi#postApprovalRequestApplyForFlag");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
projectKey String The project key
featureFlagKey String The feature flag key
environmentKey String The environment key
id String The feature flag approval request ID
postApprovalRequestApplyRequest PostApprovalRequestApplyRequest

Return type

FlagConfigApprovalRequestResponse

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Approval request apply response -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
404 Invalid resource identifier -
429 Rate limited -

postApprovalRequestForFlag

FlagConfigApprovalRequestResponse postApprovalRequestForFlag(projectKey, featureFlagKey, environmentKey, createFlagConfigApprovalRequestRequest)

Create approval request for a flag

Create an approval request for a feature flag.

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ApprovalsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ApprovalsApi apiInstance = new ApprovalsApi(defaultClient);
    String projectKey = "projectKey_example"; // String | The project key
    String featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
    String environmentKey = "environmentKey_example"; // String | The environment key
    CreateFlagConfigApprovalRequestRequest createFlagConfigApprovalRequestRequest = new CreateFlagConfigApprovalRequestRequest(); // CreateFlagConfigApprovalRequestRequest | 
    try {
      FlagConfigApprovalRequestResponse result = apiInstance.postApprovalRequestForFlag(projectKey, featureFlagKey, environmentKey, createFlagConfigApprovalRequestRequest);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ApprovalsApi#postApprovalRequestForFlag");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
projectKey String The project key
featureFlagKey String The feature flag key
environmentKey String The environment key
createFlagConfigApprovalRequestRequest CreateFlagConfigApprovalRequestRequest

Return type

FlagConfigApprovalRequestResponse

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Approval request response -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
429 Rate limited -

postApprovalRequestReview

ApprovalRequestResponse postApprovalRequestReview(id, postApprovalRequestReviewRequest)

Review approval request

Review an approval request by approving or denying changes.

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ApprovalsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ApprovalsApi apiInstance = new ApprovalsApi(defaultClient);
    String id = "id_example"; // String | The approval request ID
    PostApprovalRequestReviewRequest postApprovalRequestReviewRequest = new PostApprovalRequestReviewRequest(); // PostApprovalRequestReviewRequest | 
    try {
      ApprovalRequestResponse result = apiInstance.postApprovalRequestReview(id, postApprovalRequestReviewRequest);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ApprovalsApi#postApprovalRequestReview");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
id String The approval request ID
postApprovalRequestReviewRequest PostApprovalRequestReviewRequest

Return type

ApprovalRequestResponse

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Approval request review response -
400 Invalid request -
401 Invalid access token -
404 Invalid resource identifier -
405 Method not allowed -
409 Status conflict -
429 Rate limited -

postApprovalRequestReviewForFlag

FlagConfigApprovalRequestResponse postApprovalRequestReviewForFlag(projectKey, featureFlagKey, environmentKey, id, postApprovalRequestReviewRequest)

Review approval request for a flag

Review an approval request by approving or denying changes.

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ApprovalsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ApprovalsApi apiInstance = new ApprovalsApi(defaultClient);
    String projectKey = "projectKey_example"; // String | The project key
    String featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
    String environmentKey = "environmentKey_example"; // String | The environment key
    String id = "id_example"; // String | The feature flag approval request ID
    PostApprovalRequestReviewRequest postApprovalRequestReviewRequest = new PostApprovalRequestReviewRequest(); // PostApprovalRequestReviewRequest | 
    try {
      FlagConfigApprovalRequestResponse result = apiInstance.postApprovalRequestReviewForFlag(projectKey, featureFlagKey, environmentKey, id, postApprovalRequestReviewRequest);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ApprovalsApi#postApprovalRequestReviewForFlag");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
projectKey String The project key
featureFlagKey String The feature flag key
environmentKey String The environment key
id String The feature flag approval request ID
postApprovalRequestReviewRequest PostApprovalRequestReviewRequest

Return type

FlagConfigApprovalRequestResponse

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Approval request review response -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
404 Invalid resource identifier -
429 Rate limited -

postFlagCopyConfigApprovalRequest

FlagConfigApprovalRequestResponse postFlagCopyConfigApprovalRequest(projectKey, featureFlagKey, environmentKey, createCopyFlagConfigApprovalRequestRequest)

Create approval request to copy flag configurations across environments

Create an approval request to copy a feature flag's configuration across environments.

Example

// Import classes:
import com.launchdarkly.api.ApiClient;
import com.launchdarkly.api.ApiException;
import com.launchdarkly.api.Configuration;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.models.*;
import com.launchdarkly.api.api.ApprovalsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://app.launchdarkly.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    ApprovalsApi apiInstance = new ApprovalsApi(defaultClient);
    String projectKey = "projectKey_example"; // String | The project key
    String featureFlagKey = "featureFlagKey_example"; // String | The feature flag key
    String environmentKey = "environmentKey_example"; // String | The environment key for the target environment
    CreateCopyFlagConfigApprovalRequestRequest createCopyFlagConfigApprovalRequestRequest = new CreateCopyFlagConfigApprovalRequestRequest(); // CreateCopyFlagConfigApprovalRequestRequest | 
    try {
      FlagConfigApprovalRequestResponse result = apiInstance.postFlagCopyConfigApprovalRequest(projectKey, featureFlagKey, environmentKey, createCopyFlagConfigApprovalRequestRequest);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ApprovalsApi#postFlagCopyConfigApprovalRequest");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
projectKey String The project key
featureFlagKey String The feature flag key
environmentKey String The environment key for the target environment
createCopyFlagConfigApprovalRequestRequest CreateCopyFlagConfigApprovalRequestRequest

Return type

FlagConfigApprovalRequestResponse

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Approval request response -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
409 Status conflict -
429 Rate limited -