Alexander
(Alexander Barrios)
August 7, 2020, 5:58pm
1
Hi all!
I would like to know if there is currently (or could be implemented) an endpoint that contains information about the user
I am making an application that uses the User API Keys, everything works perfectly, but I would like to get information about the user who “logged in using their User API Key”
Something like “discourse.example.com/user.json ”
Currently I did not find something like this in Discourse API Docs, and also not while reverse engineering the API
If someone could guide me I would be very grateful!
Thanks in advance!
2 Likes
pfaffman
(Jay Pfaffman)
August 7, 2020, 10:04pm
2
Does https://meta.discourse.org/u/Alexander.json give you what you want?
Oops. Sorry.
The API Docs don’t always keep up with everything, check outHow to reverse engineer the Discourse API .
Alexander
(Alexander Barrios)
August 7, 2020, 10:29pm
3
Not really at first
Since I have not found how to obtain, at least, the username of the user
That is why an endpoint like the one I mentioned above could be useful to obtain information, even very basic, of the current user
I don’t think we’ve got an official endpoint to finding out “who I am” without giving a username.
However, you can still detect it by way of following https://meta.discourse.org/my/summary down a bit - that will redirect to the current user’s page.
4 Likes
david
(David Taylor)
August 7, 2020, 10:52pm
5
It’s not officially in the API docs, but I think https://meta.discourse.org/session/current.json might be useful for this purpose
8 Likes
Alexander
(Alexander Barrios)
August 7, 2020, 10:55pm
6
It is exactly what I needed!
Thank you very much!!
2 Likes