Where to find Bearer token for api?
In case, when I use api key from qovery console,
sample of code raises exception:
configuration = qovery.Configuration(
host="https://api.qovery.com",
access_token='qov_*****'
)
def __init__(self):
self.configuration.debug = True
self.configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
def get_app_list(self):
with qovery.ApiClient(self.configuration) as api_client:
# Create an instance of the API class
api_instance = applications_api.ApplicationsApi(api_client)
environment_id = "environmentId_example" # str | Environment ID
# example passing only required values which don't have defaults set
try:
# List applications
api_response = api_instance.list_application(environment_id)
print(api_response)
except qovery.ApiException as e:
print("Exception when calling ApplicationsApi->list_application: %s\n" % e)
“An error occurred while attempting to decode the Jwt: Invalid JWT serialization: Missing dot delimiter(s)”
def __init__(self):
self.configuration.debug = True
self.configuration.api_key['ApiKeyAuth'] = 'qov_****'
def get_app_list(self):
with qovery.ApiClient(self.configuration) as api_client:
# Create an instance of the API class
api_instance = applications_api.ApplicationsApi(api_client)
environment_id = "environmentId_example" # str | Environment ID
# example passing only required values which don't have defaults set
try:
# List applications
api_response = api_instance.list_application(environment_id)
print(api_response)
except qovery.ApiException as e:
print("Exception when calling ApplicationsApi->list_application: %s\n" % e)
Okay so your token is well taken in account in the Authorization header.
The 401 means it doesn’t give you access to the resource: either your token is wrong (copy/paste issue ?) or it doesn’t exist anymore in your organization.
Can you check on it ?