Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,297,449
Community Members
 
Community Events
165
Community Groups

Can I use the personal access token directly in an URL?

QmUser I'm New Here Apr 19, 2022

Hello guys, 

I have the  following issue: I have created a personal access token for my account and if I use the REST API and curl I can see that access is granted and I get the json content. I'm new to Confluence and using the REST API and I wonder if the following is possible:

I would like to use my personal access token this way, e.g.:

https:\\my-site.atlassian.net\wiki\home?user=<personal access token>

and that this link will give me access to my personal user page in confluence. Does Confluence offers this type of access using a link? 

If not and only thru REST API and curl, how can I navigate to my Wiki/Home page in Confluence?

Any assistance or tips will be greatly appreciated.

1 answer

1 accepted

1 vote
Answer accepted

Hi @QmUser ,

Welcome to the community!

To the best of my knowledge, you cannot use the API token to access the normal web interface of Confluence – it only works with the REST API. And as you probably already know, there is no REST endpoint to retrieve the personalized home page. 

You basically have three options here: a) you just try and fetch all the relevant information that's on the home page manually using search with different queries to get things like recently worked on etc. This might be cumbersome, but it's the best and most reliable way to work with the API.

The second approach is a bit more hackish and I would discourage going that route if at all possible. But if you really must: curl is not really different from your browser and you can make it send one or more cookies along. Most web apps – including Confluence – use session cookies to keep track of who you are. You can extract that cookie using the dev tools in your browser and use that to authenticate curl commands. Of course, that leaves you with the oh-so-great task of parsing the HTML & JS that Confluence will through at you. Personally, I prefer the neat JSON I can get from the API.

Finally, the third way involves a tool like Selenium. Selenium allows you to write code to automate a web browser, like a remote control for Chrome. You could write code that tells Selenium to open https:\\yoursite.atlassian.net, log in as your user and navigate to the home page. You can then use Selenium to get the info you want from that page. This is slightly less hackish than option two, but still a lot of work. 

So, my strong recommendation would be to find a way to find the info you need with the REST API, but there are other options out there.

Hope that helps,
 Oliver

Wow @Oliver Siebenmarck _Polymetis Apps_! Thanks a lot for the great explanation and options. I will discuss them with the team and decide which approach to take. Great job, thanx!

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

An update on Confluence Cloud customer feedback – June 2022

Hi everyone, We’re always looking at how to improve Confluence and customer feedback plays an important role in making sure we're investing in the areas that will bring the most value to the most c...

55 views 0 0
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you