This repository contains a client library for LaunchDarkly's REST API. This client was automatically generated from our OpenAPI specification.
This REST API is for custom integrations, data export, or automating your feature flag workflows. DO NOT use this client library to add feature flags to your web or mobile application. To integrate feature flags with your application, please see the SDK documentation
Building the API client library requires Maven to be installed.
To install the API client library to your local Maven repository, simply execute:
mvn installTo deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn deployRefer to the official documentation for more information.
Add this dependency to your project's POM:
<dependency>
<groupId>com.launchdarkly</groupId>
<artifactId>api-client</artifactId>
<version>2.0.3</version>
<scope>compile</scope>
</dependency>Add this dependency to your project's build file:
compile "com.launchdarkly:api-client:2.0.3"At first generate the JAR by executing:
mvn package
Then manually install the following JARs:
- target/api-client-2.0.3.jar
- target/lib/*.jar
Please follow the installation instruction and execute the following Java code:
import com.launchdarkly.api.*;
import com.launchdarkly.api.auth.*;
import com.launchdarkly.api.model.*;
import com.launchdarkly.api.api.AuditLogApi;
import java.io.File;
import java.util.*;
public class AuditLogApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: Token
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
Token.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Token.setApiKeyPrefix("Token");
AuditLogApi apiInstance = new AuditLogApi();
BigDecimal before = new BigDecimal(); // BigDecimal | A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries returned will have before this timestamp.
BigDecimal after = new BigDecimal(); // BigDecimal | A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries returned will have occured after this timestamp.
String q = "q_example"; // String | Text to search for. You can search for the full or partial name of the resource involved or fullpartial email address of the member who made the change.
BigDecimal limit = new BigDecimal(); // BigDecimal | A limit on the number of audit log entries to be returned, between 1 and 20.
String spec = "spec_example"; // String | A resource specifier, allowing you to filter audit log listings by resource.
try {
AuditLogEntries result = apiInstance.getAuditLogEntries(before, after, q, limit, spec);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AuditLogApi#getAuditLogEntries");
e.printStackTrace();
}
}
}All URIs are relative to https://app.launchdarkly.com/api/v2
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AuditLogApi | getAuditLogEntries | GET /auditlog | Get a list of all audit log entries. The query parameters allow you to restrict the returned results by date ranges, resource specifiers, or a full-text search query. |
| AuditLogApi | getAuditLogEntry | GET /auditlog/{resourceId} | Use this endpoint to fetch a single audit log entry by its resouce ID. |
| CustomRolesApi | deleteCustomRole | DELETE /roles/{customRoleKey} | Delete a custom role by key. |
| CustomRolesApi | getCustomRole | GET /roles/{customRoleKey} | Get one custom role by key. |
| CustomRolesApi | getCustomRoles | GET /roles | Return a complete list of custom roles. |
| CustomRolesApi | patchCustomRole | PATCH /roles/{customRoleKey} | Modify a custom role by key. |
| CustomRolesApi | postCustomRole | POST /roles | Create a new custom role. |
| EnvironmentsApi | deleteEnvironment | DELETE /projects/{projectKey}/environments/{environmentKey} | Delete an environment in a specific project. |
| EnvironmentsApi | getEnvironment | GET /projects/{projectKey}/environments/{environmentKey} | Get an environment given a project and key. |
| EnvironmentsApi | patchEnvironment | PATCH /projects/{projectKey}/environments/{environmentKey} | Modify an environment by ID. |
| EnvironmentsApi | postEnvironment | POST /projects/{projectKey}/environments | Create a new environment in a specified project with a given name, key, and swatch color. |
| FeatureFlagsApi | deleteFeatureFlag | DELETE /flags/{projectKey}/{featureFlagKey} | Delete a feature flag in all environments. Be careful-- only delete feature flags that are no longer being used by your application. |
| FeatureFlagsApi | getFeatureFlag | GET /flags/{projectKey}/{featureFlagKey} | Get a single feature flag by key. |
| FeatureFlagsApi | getFeatureFlagStatus | GET /flag-statuses/{projectKey}/{environmentKey}/{featureFlagKey} | Get the status for a particular feature flag. |
| FeatureFlagsApi | getFeatureFlagStatuses | GET /flag-statuses/{projectKey}/{environmentKey} | Get a list of statuses for all feature flags. The status includes the last time the feature flag was requested, as well as the state of the flag. |
| FeatureFlagsApi | getFeatureFlags | GET /flags/{projectKey} | Get a list of all features in the given project. |
| FeatureFlagsApi | patchFeatureFlag | PATCH /flags/{projectKey}/{featureFlagKey} | Perform a partial update to a feature. |
| FeatureFlagsApi | postFeatureFlag | POST /flags/{projectKey} | Creates a new feature flag. |
| ProjectsApi | deleteProject | DELETE /projects/{projectKey} | Delete a project by key. Caution-- deleting a project will delete all associated environments and feature flags. You cannot delete the last project in an account. |
| ProjectsApi | getProject | GET /projects/{projectKey} | Fetch a single project by key. |
| ProjectsApi | getProjects | GET /projects | Returns a list of all projects in the account. |
| ProjectsApi | patchProject | PATCH /projects/{projectKey} | Modify a project by ID. |
| ProjectsApi | postProject | POST /projects | Create a new project with the given key and name. |
| RootApi | getRoot | GET / | |
| TeamMembersApi | deleteMember | DELETE /members/{memberId} | Delete a team member by ID. |
| TeamMembersApi | getMember | GET /members/{memberId} | Get a single team member by ID. |
| TeamMembersApi | getMembers | GET /members | Returns a list of all members in the account. |
| TeamMembersApi | patchMember | PATCH /members/{memberId} | Modify a team member by ID. |
| TeamMembersApi | postMembers | POST /members | Invite new members. |
| UserSegmentsApi | deleteUserSegment | DELETE /segments/{projectKey}/{environmentKey}/{userSegmentKey} | Delete a user segment. |
| UserSegmentsApi | getUserSegment | GET /segments/{projectKey}/{environmentKey}/{userSegmentKey} | Get a single user segment by key. |
| UserSegmentsApi | getUserSegments | GET /segments/{projectKey}/{environmentKey} | Get a list of all user segments in the given project. |
| UserSegmentsApi | patchUserSegment | PATCH /segments/{projectKey}/{environmentKey}/{userSegmentKey} | Perform a partial update to a user segment. |
| UserSegmentsApi | postUserSegment | POST /segments/{projectKey}/{environmentKey} | Creates a new user segment. |
| UserSettingsApi | getUserFlagSetting | GET /users/{projectKey}/{environmentKey}/{userKey}/flags/{featureFlagKey} | Fetch a single flag setting for a user by key. |
| UserSettingsApi | getUserFlagSettings | GET /users/{projectKey}/{environmentKey}/{userKey}/flags | Fetch a single flag setting for a user by key. |
| UserSettingsApi | putFlagSetting | PUT /users/{projectKey}/{environmentKey}/{userKey}/flags/{featureFlagKey} | Specifically enable or disable a feature flag for a user based on their key. |
| UsersApi | deleteUser | DELETE /users/{projectKey}/{environmentKey}/{userKey} | Delete a user by ID. |
| UsersApi | getSearchUsers | GET /user-search/{projectKey}/{environmentKey} | Search users in LaunchDarkly based on their last active date, or a search query. It should not be used to enumerate all users in LaunchDarkly-- use the List users API resource. |
| UsersApi | getUser | GET /users/{projectKey}/{environmentKey}/{userKey} | Get a user by key. |
| UsersApi | getUsers | GET /users/{projectKey}/{environmentKey} | List all users in the environment. Includes the total count of users. In each page, there will be up to 'limit' users returned (default 20). This is useful for exporting all users in the system for further analysis. Paginated collections will include a next link containing a URL with the next set of elements in the collection. |
| WebhooksApi | deleteWebhook | DELETE /webhooks/{resourceId} | Delete a webhook by ID. |
| WebhooksApi | getWebhook | GET /webhooks/{resourceId} | Get a webhook by ID. |
| WebhooksApi | getWebhooks | GET /webhooks | Fetch a list of all webhooks. |
| WebhooksApi | patchWebhook | PATCH /webhooks/{resourceId} | Modify a webhook by ID. |
| WebhooksApi | postWebhook | POST /webhooks | Create a webhook. |
- Actions
- AuditLogEntries
- AuditLogEntry
- AuditLogEntryTarget
- Clause
- CustomRole
- CustomRoleBody
- CustomRoles
- Environment
- EnvironmentBody
- Fallthrough
- FeatureFlag
- FeatureFlagBody
- FeatureFlagConfig
- FeatureFlagStatus
- FeatureFlagStatuses
- FeatureFlags
- Link
- Links
- Member
- Members
- MembersBody
- PatchComment
- PatchOperation
- Policy
- Prerequisite
- Project
- ProjectBody
- Projects
- Resources
- Role
- Rollout
- Rule
- Statement
- Statements
- Target
- User
- UserFlagSetting
- UserFlagSettings
- UserRecord
- UserSegment
- UserSegmentBody
- UserSegmentRule
- UserSegments
- UserSettingsBody
- Users
- Variation
- Webhook
- WebhookBody
- Webhooks
- WeightedVariation
Authentication schemes defined for the API:
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.