The discussion revolves around the lack of documentation for the User/Mobile API in Discourse. evaryont notes that while the mobile app uses the /user-api-key/new route, it’s not documented, raising questions about API key generation for SSO users. j.jaffeux clarifies that the HEAD /user-api-key/new request is for verification, not key creation, and explains the mobile app’s use of an authToken for authentication. They also point to the notifications API documentation and suggest examining the mobile app code for further details. sam directs to the updated documentation at https://meta.discourse.org/t/user-api-keys-specification/48536.
I was looking at the Discourse Mobile app source code and noticed it using the user API keys, and calling /user-api-key/new but I don’t see any reference to that in the Discourse API documentation. Are the routes documented anywhere beyond the source code?
And, how do users from SSO get their own API key? Most documentation that I find mention getting the API key from the admin panel, but that won’t work for me. I’d like to get a list of notifications from here, on meta, and other instances of discourse where I’m just a user. Similar to what the mobile app does already, but I’d like to use the information in a different context.
The HEAD /user-api-key/new request you are seeing is not creating anything, it’s mostly to check the site exists and it has the correct auth API version.
Concerning the notifications, the documentation is here: Discourse API Docs (I do agree it’s probably incomplete, you might want to grep DiscourseMobile code for “/notifications”)