Basic API Call Flows

Hi All,

I am new to mender. I have been looking at the API documentation.
How can i get an access token with user credentials? The api documentation for ‘Login’ flow shows the use of 2FA and needs a Bearer token in header. How do i get the Bearer token for an account?

Thanks

Hello @kirklogitech,

If you are using Hosted Mender, you can generate a Personal Access Token and use it to perform API calls. These tokens have a long expiration time (up to one year) and do not require the 2FA code. If you are running Mender Open-Source, this feature will be part of the Mender 3.4 upcoming release scheduled at the end of September 2022.

Best regards,
Fabio

Hi @tranchitella,

Thanks for the quick reply. How do i generate a Personal Access Token? I don’t see that in my account settings. I am on a Free Trial on Hosted Mender.

Thanks

@kirklogitech you can find the personal access tokens in the view “My profile”.

@tranchitella is it not available for free accounts ? I don’t see it in my profile view

@kirklogitech it is not available if you log in using the single-sign-on feature.
I’d suggest creating a dedicated (email-password-based) user for API automation, log in with that account and generate the personal access tokens there.

That worked. Thanks @tranchitella