Alexander
(Alexander Barrios)
2020 年 8 月 7 日午後 5:58
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
pfaffman
(Jay Pfaffman)
2020 年 8 月 7 日午後 10:04
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)
2020 年 8 月 7 日午後 10:29
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
david
(David Taylor)
2020 年 8 月 7 日午後 10:52
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
Alexander
(Alexander Barrios)
2020 年 8 月 7 日午後 10:55
6
It is exactly what I needed!
Thank you very much!!
「いいね!」 2