Unless you use a programming language that is not officially supported by Tggl, we recommend using one of our SDKs to interact with the API. They are all open-source and should help you get started quickly.
The Tggl API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
You can query the API from the user's browser (CORS is enabled), mobile device, or from your servers.
All API calls must be authenticated with your API key in the
X-Tggl-API-Key header. You will find your API key in the
curl 'https://api.tggl.io/<endpoint>' \ -H 'x-tggl-api-key: <api key>'
Client vs. Server key
Each project has its own set of client and server key which allows you to perform different actions:
|Client key||Server key|
|Evaluate flags via API||✅||✅|
|Fetch flags configuration and evaluate flags locally||❌||✅|
Never publish the server key to your client apps, or you risk exposing sensitive information. Client applications do not need to evaluate flags locally since Tggl is already optimised to perform a single API call when the app starts.