# Is it possible to get a user by its Discourse ID from the Discourse API?

**URL:** <https://meta.discourse.org/t/is-it-possible-to-get-a-user-by-its-discourse-id-from-the-discourse-api/90014>\
**Category:** Product Support\
**Created:** [June 16, 2018, 11:14am UTC](https://meta.discourse.org/t/is-it-possible-to-get-a-user-by-its-discourse-id-from-the-discourse-api/90014 "2018-06-16T11:14:54Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [July 6, 2018, 10:27pm UTC](https://meta.discourse.org/t/is-it-possible-to-get-a-user-by-its-discourse-id-from-the-discourse-api/90014/6 "2018-07-06T22:27:57Z")

</div>

> [@Canapin](#):
>
> 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](https://github.com/discourse/wp-discourse) plugin, there is a function that you can use for this:

```plaintext
WPDiscourse\Utilities\Utilities::get_discourse_user($user_id)

```

`$user_id` in the function call is the WordPress user\_id.

---

_[View the full topic](https://meta.discourse.org/t/is-it-possible-to-get-a-user-by-its-discourse-id-from-the-discourse-api/90014)._
