<@U04S8PLJWMT> how do i get a access token which i...
# ask-ai
k
@kapa.ai how do i get a access token which is not forbidden for https://api.airbyte.com/api/public/v1/connections
k
To get an access token that is accepted (not forbidden) for requests to 
https://api.airbyte.com/api/public/v1/connections
, you need to follow these steps: 1. Create an Application in Airbyte UI - Log in to the Airbyte UI. - Go to Settings → Account → Applications. - Click "Create an application" and give it a name. - You will receive a
client_id
and
client_secret
(the secret can be revealed by clicking the icon next to it). 2. Obtain an Access Token - Use your
client_id
and
client_secret
to request an access token from the Airbyte API:
Copy code
bash    curl -X POST https://api.airbyte.com/api/v1/applications/token \      -H "Content-Type: application/json" \      -d '{        "client_id": "<your_client_id>",        "client_secret": "<your_client_secret>"      }'
- The response will include an
access_token
. This token is valid for 3 minutes, so you may need to fetch a new one before each request. 3. Use the Access Token - Include the access token as a Bearer token in the Authorization header when making requests:
Copy code
bash    curl -X GET https://api.airbyte.com/api/public/v1/connections \      -H "Authorization: Bearer <access_token>"
Important Notes: - If you get a 403 Forbidden error, double-check that your access token is valid (not expired) and that you are using the correct
client_id
and
client_secret
. - Make sure you are using the correct endpoint and that your application has the necessary permissions. - Access tokens are short-lived (3 minutes), so always use a fresh token for each request if possible. For more details, see the official documentation: [Configuring API Access](https://docs.airbyte.com/platform/using-airbyte/configuring-api-access) and [API Documentation](https://docs.airbyte.com/platform/api-documentation).
k
i have been trying this but was getting forbidden
@kapa.ai reply
k
A message from kapa.ai
To obtain an access token that is accepted (not forbidden) for 
https://api.airbyte.com/api/public/v1/connections
, follow these steps: 1. Create an Application in the Airbyte UI - Log in to the Airbyte UI. - Navigate to Settings → Account → Applications. - Click "Create an application" and note the generated
client_id
and
client_secret
(reveal the secret if needed). 2. Obtain an Access Token - Use your
client_id
and
client_secret
to request an access token:
Copy code
bash    curl -X POST https://api.airbyte.com/api/v1/applications/token \      -H "Content-Type: application/json" \      -d '{        "client_id": "<your_client_id>",        "client_secret": "<your_client_secret>"      }'
- The response will include an
access_token
(valid for 3 minutes). 3. Use the Access Token - Make your API request with the access token in the Authorization header:
Copy code
bash    curl -X GET https://api.airbyte.com/api/public/v1/connections \      -H "Authorization: Bearer <access_token>"
Notes: - If you receive a 403 Forbidden error, ensure your token is valid (not expired) and that you are using the correct credentials. - Access tokens are short-lived (3 minutes), so fetch a new one before each request if needed. - This process applies to both Airbyte Cloud and Self-Managed deployments, but for Self-Managed, replace the base URL with your deployment’s URL. For more details, see the official documentation on [Configuring API Access](https://docs.airbyte.com/platform/using-airbyte/configuring-api-access) and [API documentation](https://docs.airbyte.com/platform/1.7/api-documentation).