Blog Post

Tech Talk
1 MIN READ

How to use a bearer token for authentication using Python SDK

Javier's avatar
Javier
Icon for Neophyte rankNeophyte
7 months ago

I am trying to use a bearer token for authentication using Python SDK.

On the documentation I found several examples using the LMv1 access_id and access_key values, like this:

# Configure API key authorization: LMv1
configuration = logicmonitor_sdk.Configuration()
configuration.company = 'YOUR_COMPANY'
configuration.access_id = 'YOUR_ACCESS_ID'
configuration.access_key = 'YOUR_ACCESS_KEY'

# create an instance of the API class
api_instance = logicmonitor_sdk.LMApi(logicmonitor_sdk.ApiClient(configuration))

but couldn’t find any example on using bearer token for authentication.

After some search I found something about defining “api_token” and “api_token_prefix” but couldn’t get it to work.

Anybody have any example I could follow to use this?

Published 7 months ago
Version 1.0

21 Comments