Authentication
Before you can access an endpoint within Confidence, you need to have valid authentication. Two kinds of APIs exist in Confidence: the management API that you use to configure the different entities in the platform (flags, experiments, fact tables etc), and the resolve/events API that you use in the Client SDKs to resolve flag values and emit events. Because these two kinds have different characteristics, they use different methods for authentication. For the resolve API, you create a “Client” which has anAPI_TOKEN that you use to authenticate. This API token is long-lived so you
can, for example, bundle it inside your mobile app to resolve flags. A client can have multiple API tokens attached to it, to allow
for rotating tokens as needed. You create clients in the Admin panel in Confidence.
The management API uses a Client Credentials OAuth flow,
where you supply a client ID and a client secret and in exchange get an access token that is valid for 24 hours. The token is then included in
all requests to the API in an HTTP header. You create API clients in the Admin panel in Confidence.
Request a Token for an API Client
Pagination
List resources allow for pagination by allowing apage_token and a page_size in the requests.
If there are more results, a list response has a next_page_token field.
Use this token in the next request to ask for the next page of results.
Resource Names
The API uses resource names to uniquely identify each entity that you can use to reference that resource. A resource name consists of a type and an identifier, for exampleflags/my-flag. A resource name can be hierarchical if the parent owns a child resource.
The resource name can then have multiple levels, for example flags/my-flag/variants/control.
Response Status Codes
The Confidence API uses standard HTTP status codes to signal the status of a request to a consumer, for example200 (OK), 401 (Unauthorized), 404 (Not found).

