Api access token

Is there an API to get the API_ACCESS_TOKEN given an application ID and user/pwd for the experience, for example?
Reason being, if I am writing an application to access certain info from Losant side on devices or tables etc. calling through API need this Bearer token to be passed.

Hi @Sreyams_Jain1,

Just a couple of quick questions! Could you provide a bit more detail on your use case with experiences here? You mention using an experience username and password, is this an experience workflow you want to build or are you exclusively using the API?

Losant does not store Application Tokens once they have been created, so there is not a way to obtain that value again. There is a note with more information on this when tokens are created:

We do have actions for Tokens within our API, and the POST action can create new API tokens. However, the request will need to be authenticated within the Bearer authorization using an existing API token.

Thanks so much!
Julia

I am trying to write an external application and want to use Losant APIs and build my own visualization. I will be calling for example, knowing an application id, to get the list of devices and then want to use one of the deviceIDs to get device state or get a history of device states for a time period etc. and other apis as needed. I will have confgured the losant experiences with users (email/pwd). So, I want to make sure the experience user is first authorised to access the losant info. For all these API calls, I need that Bearer ACCESS_TOKEN to pass as the auth header

Hi @Sreyams_Jain1,

An additional question for you as you mentioned using application IDs. Is this multiple applications, or just one? Is it a single or multi-tenant experience?

It sounds as though you are looking for functionality similar to what is built in the Experience API How-to Guide. You can follow this guide to create custom endpoints that verify users with their login credentials and return data from the API. Keep in mind, however, that this approach may be more difficult to work with depending on the architecture of your use case.

Thanks!
Julia