Hi. I guess all is in the title.
There is https://meta.discourse.org/u/canapin.json but I don’t think there’s a route that uses the user id.
There is only one route that works with an id and no username that I know of. (which seems odd to me because usernames can change whereas ids can’t.)
Anyway, it’s a staff-only route, eg.
https://meta.discourse.org/admin/users/174238.json
If you are using SSO, there is the /users/by-external/{$user_id}.json
route.
Is the discourse ID equal to the external ID?
No, the external_id is the id that is provided in the SSO payload from the SSO provider site. If you are using the WP Discourse plugin, there is a function that you can use for this:
WPDiscourse\Utilities\Utilities::get_discourse_user($user_id)
$user_id
in the function call is the WordPress user_id.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.