Get the user name of the current user on My Confluence Cloud instance

Hi ,
I’am develloping an add-on on Confluence Cloud , to get the userName of the curent user i used this “GET /rest/api/user/current” like mentiond in the link of Atlassian RESTapi here :
https://ideationcloud.atlassian.net/wiki/rest/api/user/current
but i get as a result this ==> "username: ‘addon_fr.spectrumgroupe.confluence.cloud.plugins.ideation’
wich is a concatination between the word ‘addon’ and ‘the key of my add-on that write in the decriptor’ (Atlassian-connect)
i didn’t understand why i get this result i am stuck in this level please help as soon as possible .

Thnks For Help
Regards
Held Basma

Instead of making a REST request that takes extra time, there is already a built-in function of the Atlassian Connect Javascript library that allows you to get the current user: https://developer.atlassian.com/static/connect/docs/latest/javascript/module-User.html#.getUser

1 Like

Hi @stephendeutsch1

I aleady found the solution , in my case with NodeJs i took it from req like this way :
userID = req.query[‘user_id’];

I apreciate your help any way ^^

Regards
HELD Basma