Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Stash - how to get the identity of the connected user via the REST API

Pascal Paulis September 28, 2014

Hello,

in the Stash REST API, after having retrieved an oauth token, I'd like to get the identity of the connected user (username, email, ...). But I can't find a resource in the doc that let me do it without knowing the username at least.

Is there a way to achieve this without knowing the username?

 

Any help is appreciated smile

Thanks!

Pascal

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

3 votes
Answer accepted
TimP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 29, 2014

Hi Pascal,

There isn't a resource that returns all of the authenticated user's profile information that I know of (though this sounds like a useful feature - I'd raise an issue at https://stash.atlassian.com in the STASH project to request it). However, you can retrieve the username of the currently authenticated user by doing a GET to the following resource (relative to the base URL of your Stash server):

/plugins/servlet/applinks/whoami

You can then use this username to retrieve the rest of the user's profile data from the REST API. 

Hope this helps!

cheers,

Tim

Pascal Paulis September 30, 2014

Great! Thank you very much! That saves me. I'll create an issue shortly.This should at least be part of the documentation.

TAGS
AUG Leaders

Atlassian Community Events