Authentication with the Gaana AI B2B API
The Gaana AI B2B API uses JWT bearer tokens to authenticate requests. To get a bearer token, you first need to have an API key.Step 1: Obtain your API Key
To get your API key, please follow these steps:- Log in to your Gaana AI account.
- Navigate to the “API Settings” page in your dashboard.
- You will find your API key there. If you haven’t generated one yet, you can do so on that page.
Treat your API key like a password and keep it secure. Do not expose it in client-side code.
Step 2: Get a Bearer Token
Once you have your API key, you can exchange it for a JWT bearer token by making aPOST request to the /get_auth_token endpoint.
Here is an example of how to do this using cURL:
YOUR_API_KEY with the API key you obtained in the previous step.
The response will contain your access_token, which is your JWT bearer token.
Step 3: Making Authenticated Requests
To make authenticated requests to the API, include theaccess_token in the Authorization header of your requests, prefixed with “Bearer ”.
Here is an example of an authenticated request to list your creative concepts:
your_jwt_bearer_token with the access token you received in the previous step.