- Create an API client if you haven’t done so
- Request an access token
- Use the access token to request a list of flags
Before You Begin
- This tutorial assumes you have a Confidence account.
- Use cURL to make API calls. You can install cURL using the package manager of your choice.
Create an API Client
An API client provides a client ID and client secret needed to request an access token by implementing any of the authorization flows.Request an Access Token
The access token is a string which has the credentials and permissions that you can use to access a given resource (for example, flags, events, and metrics). To request the access token you first need your client ID and client secret:
With the credentials in hand, you are ready to request an access token. This
tutorial uses the client credentials flow, so you must:
Request
Response
Example: Request a List of Flags
For this example, use the list flags endpoint in the Flags API to request information about existing feature flags. Your API call must include the access token you have just generated using theAuthorization header as follows:
Request
Response
Summary
The Confidence platform provides different APIs depending on the functionality you want to access. The API calls must include the Authorization header along with a valid access token. This tutorial makes use of the client credentials grant type to retrieve the access token. That works fine in scenarios where you control the API call to Confidence, for example where your backend is connecting to the API. It does not work in cases where your app connects on behalf of a specific user, for example when getting private playlist or profile data.What’s Next?
- The tutorial used the Flags API to retrieve a list of flags. An interesting exercise would be to extend the example by trying to create a flag. Do you accept the challenge?
- The API basics page provides more information on how to work with Confidence platform APIs.

