# How to obtain the user\_id so I can issue a logout API call

**URL:** <https://meta.discourse.org/t/how-to-obtain-the-user-id-so-i-can-issue-a-logout-api-call/102033>\
**Category:** SSO\
**Created:** [14.Ноябрь.2018 14:55:32 UTC](https://meta.discourse.org/t/how-to-obtain-the-user-id-so-i-can-issue-a-logout-api-call/102033 "2018-11-14T14:55:32Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [14.Ноябрь.2018 15:19:01 UTC](https://meta.discourse.org/t/how-to-obtain-the-user-id-so-i-can-issue-a-logout-api-call/102033/2 "2018-11-14T15:19:01Z")

</div>

> [@TeoWneD](#):
>
> What is the query, that can return the UID, when i input username.

`GET https://example.com/u/USERNAME.json`

> [@TeoWneD](#):
>
> Can’t we just use sso,sig and token to identify ourself to the forum ? i mean by that that the main website already has those information, is there any way to use it to identify the user we want to logout

Since you implement SSO, you have the `external_id` of the user, so you can use:

`GET https://example.com/u/by-external/EXTERNAL_ID`

---

_[View the full topic](https://meta.discourse.org/t/how-to-obtain-the-user-id-so-i-can-issue-a-logout-api-call/102033)._
