The REST API

3 minute readReference

The CloudBees Feature Management REST API adheres to the principles of Representational State Transfer (REST). The CloudBees Feature Management REST API implements URI resources, HTTP responses, and formats data in JSON files.

You can use the CloudBees Feature Management REST API to do the following:

  • post data to CloudBees Feature Management

  • get data from CloudBees Feature Management

  • build custom integrations

  • build on top of the CloudBees Feature Management platform

As a security measure, a rate limit has been implemented to one request per second, and is based on the requester IP address. Any requests at rates that exceed the rate limit will receive a 555 error status code. There are no exceptions we can currently make for customers at this time.

Experiments have been deprecated and Flags are the only entity in the system.

The system is backwards compatible, but until a new version of the CloudBees Feature Management REST API is released, note the following issues:

  • Create an experiment - creates a corresponding flag, ignoring the experiment name.

  • Get experiment - works as expected, ignoring the experiment name.

  • Patch experiment - works as expected, ignoring the experiment name.

  • Get experiments - returns only flags that have at least one release rule configured.

  • Delete experiment - removes a flag’s configuration and/or impression data, but does NOT delete the flag.

The CloudBees Feature Management Postman collection

Postman is an API platform for developers to build and test APIs. CloudBees Feature Management has a Postman collection containing useful examples to help you connect your application to CloudBees Feature Management.

You can fork the collection into your workspace.

After forking the collection into your Postman workspace, configure it to use your API user token:

  1. In Postman, select CloudBees Feature Management API.

  2. Select the Authorization tab.

  3. Select Bearer Token as the Type.

  4. In the Token field, enter your user token. Refer to Authentication for more information.

Adding an API user token to a fork of the CloudBees Feature Management Postman collection.
Figure 1. Adding an API user token to a fork of the CloudBees Feature Management Postman collection.

The forked CloudBees Feature Management Postman collection has authorization set up with your user token.

Application ID

All resources are part of a CloudBees Feature Management app. The Application ID is unique for each CloudBees Feature Management app.

To access and copy the application ID:

  1. From the CloudBees Feature Management Home page, select All apps from the left pane, and then select the app.

  2. Select App settings  Integrations.

  3. In the API section, select Copy to copy the Application ID to your clipboard.

The application ID is available for use in your REST API configuration.

Authentication

All requests to the CloudBees Feature Management REST API must be authenticated with a user token.

Your API user token remains the same for any app within your CloudBees Feature Management organization. If you are a member of multiple organizations, a different user token is generated for each organization.

Accessing the user token

Every CloudBees Feature Management user has a unique API token. The API user token inherits the permission of its owner. The Audit log displays the actions taken by the owner of the user token. Refer to Audit log for more information.

To access and copy the API user token:

  1. From the CloudBees Feature Management Home page, select All apps from the left pane, and then select the app.

  2. Select App settings  Integrations.

  3. In the API section, select Show to display the User token.

  4. Show is now displayed as Copy. Select this Copy to copy the User token to your clipboard.

Selecting Copy to copy the User token.
Figure 2. Selecting Copy to copy the User token.

The user token is available for use in your REST API configuration.

Regenerating a user token

When a new token is generated, access to the previous user token is revoked. Any use of the previous token is rejected.

To regenerate a user token:

  1. From the CloudBees Feature Management Home page, select All apps from the left pane, and then select the app.

  2. Select App settings  Integrations.

  3. In the API section, select Regenerate.

  4. If you agree with the warning information, select Yes, I understand and accept the risks associated with this action.

  5. Select Regenerate.

Regenerating a user token
Figure 3. Regenerating a User token

Your new user token is generated, and access to your previous user token is revoked.

Authentication header

You can authenticate with your user token by adding an authorization header containing your token.

Authorization: Bearer API_TOKEN