Basic question : fomat of "Bearer Access Token" in lifecycle API

I have a basic question about “Bearer access token” in lifecycle REST API.

I generated API Token and Org ID on admin.atlassian.com for lifecycle API described
as https://developer.atlassian.com/cloud/admin/user-management/rest/api-group-lifecycle/ .

Unfortunately sample Code describes only "–header ‘Authorization: Bearer <access_token>’ " but not describe how to construct “access_token” from these 2 strings.

I’d appreciated if you answer to my basic question.
Thanks.

Hi @ChiharaNaruhito,

Welcome to our Developer Community.

When using the Bearer access token, all that you need is the API Token itself. There is no need to combine the Org ID with the API Token.

Just replace the <access_token> in the request with the API token generated (please note that it’s called API key in the UI).

The Org ID is shown so that it can be used where required, like when using the Organizations REST API.

Hope this helps,
Caterina

Caterina,
Thank you for your prompt response and kindness.

If API token for lifecycle REST API is generated by Admin user who is different REST API run-user, what does happen?
Getting return the 401?

Hi @ChiharaNaruhito,

Happy to help here.

When using bearer tokens, the user running the command is not relevant as all the authentication & authorization details are managed by the token itself.

This means that any user in possession of the bearer token will receive the same response from the API.

Caterina

Thank you.

In fact, our customer gets 401 with bearer API Token which is generated by Org Admin.
Do you have any idea?

Regards.