- 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.1
Go to Confidence
2
Navigate to API Clients
On the bottom of the left sidebar, select Admin > API Clients.
3
Click Create
4
Enter display name
Enter
API client as the Display name.5
Click Save
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:1
Go to Confidence
2
Navigate to API Clients
On the bottom of the left sidebar, select Admin > API Clients.
3
Select the API client
Select the API client you just created. You find the client ID immediately on the page. The client secret is available behind the View client secret link.
1
Send a POST request to the token endpoint URL
2
Add the Content-Type header
Set to the
application/json value.3
Add the HTTP body
Include the
clientId and clientSecret, along with the grantType parameter set to client_credentials.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.

