API for token generation for external application.
Asked by Sweta Pawar:

We trying to integrate Confluence with our application as part of help and support.

We want to add authorization mechanism where a user having a particular access in application will be able to view or search information related to his account only.

Kindly share an API for token generation.


Answers:
author: Daniel Ebers
body: Hi [@Sweta Pawar](/t5/user/viewprofilepage/user-id/4850245)

which kind of deployment do you use? Is is Confluence Cloud or Confluence Server?

Maybe you are referring to Personal Access Tokens?  
<https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html>

At least I can share, they can issued via REST API.

Other than that and assuming you are using Confluence Cloud did you probable mean something like OAuth access tokens?

<https://support.atlassian.com/confluence-cloud/docs/manage-oauth-access-tokens/>

By closer looking into your question it semme to me you successfully created an API token for some users but look for a way doing that programmatically (in other words authentication with a super user for Atlassian Account and creating API based an API token for users, is that correct?).

According to this documentation...:

<https://developer.atlassian.com/cloud/admin/user-management/rest/api-group-users/#api-users-accountid-manage-api-tokens-get>

... it seems not being possible. Getting the API tokens of the users and deleting the API tokens is possible. But the page does not describe an option to set an API token.

Regards,  
Daniel


author: Srinatha T
body: Hi [@Sweta Pawar](/t5/user/viewprofilepage/user-id/4850245) ,

Welcome to Atlassian community.

Below URL will help you create tokens in atlassian account for confluence cloud.

* [Manage-api-tokens-for-your-atlassian-account](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/)

The above page has info like how to create and use an API token. I hope above info helps.

Have a good day!

Thanks,

Srinath T

comments: author: Sweta Pawar
body: Hi Srinath,

Thankyou for reverting.

Actually we are working on integrating of Confluence where all our documentation is saved with our manufacturing application as part of help and support feature. We tested some api on postman using username and password but it's not working and instead if we use token id it works.

As part of authorization features we will be restricting access of the users based on role so a user with particular role will be able to view information related to his role only. As there are many users it is not possible to give access to individual users.

So we are looking out for an API which can generate token.


author: Srinatha T
body: Hi [@Sweta Pawar](/t5/user/viewprofilepage/user-id/4850245) ,

Thanks for the detailed info. Yes, try the above it has examples which will help you understand how it works. It should help.

Have a good day!

Cheers

Srinath T


author: Sweta Pawar
body: Hi Srinath,

Followed the step given in page <https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/#Use-an-API-token>.

But it is not working. We need an API which can generate the token.


author: Srinatha T
body: Hi [@Sweta Pawar](/t5/user/viewprofilepage/user-id/4850245) ,

What is happening ? I am not an expert on API and I have not used these token API's myself. I am not sure If i will be of much help here. I will give a try.

Thanks,

Srinath T


author: Sweta Pawar
body: Hi [@Srinatha T](/t5/user/viewprofilepage/user-id/4686256) Is there any way out for this or any reference can help to resolve the issue because we are stuck here. If this works then only will be able to do the integration with confluence else will have to find a work around.


author: Srinatha T
body: [@Sweta Pawar](/t5/user/viewprofilepage/user-id/4850245) , I am still not clear as to what is happening when you tried to create token using the above method ?


author: Sweta Pawar
body: [@Srinatha T](/t5/user/viewprofilepage/user-id/4686256) Our ask is that is there any token generation API for confluence? We know how to create a token manually from confluence's website, but, how can we replicate the same in our code?


author: Sweta Pawar
body: [@Srinatha T](/t5/user/viewprofilepage/user-id/4686256) Is it possible to arrange meeting with Confluence support team. We can show what are our finding and where we have stuck.


author: Srinatha T
body: Hi [@Sweta Pawar](/t5/user/viewprofilepage/user-id/4850245) , could you please open a support ticket with all the info. The support can help you further on this.


author: Sweta Pawar
body: [@Srinatha T](/t5/user/viewprofilepage/user-id/4686256) Please let me know how can I raise the support ticket. I am trying to raise but it is directing me to same same page. (Current page)