# Error on retrieving users... "Must provide a valid Client-ID or OAuth token"

**URL:** <https://discuss.dev.twitch.com/t/error-on-retrieving-users-must-provide-a-valid-client-id-or-oauth-token/21750>\
**Category:** API\
**Created:** [July 8, 2019, 9:02pm UTC](https://discuss.dev.twitch.com/t/error-on-retrieving-users-must-provide-a-valid-client-id-or-oauth-token/21750 "2019-07-08T21:02:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![izikperz](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/izikperz/32/6675_2.png) [@izikperz](https://discuss.dev.twitch.com/u/izikperz)\
**Post date:** [July 8, 2019, 9:02pm UTC](https://discuss.dev.twitch.com/t/error-on-retrieving-users-must-provide-a-valid-client-id-or-oauth-token/21750/1 "2019-07-08T21:02:48Z")

</div>

I am trying a simple request to get some user by ID as specified in the API reference guide([https://dev.twitch.tv/docs/api/reference/#get-users](https://dev.twitch.tv/docs/api/reference/#get-users)). I have tried the GET request in a REST console with `Authorization` as the header name and `Bearer myclientid` as the header value and I get this response:  
{  
“error”: “Unauthorized”,  
“status”: 401,  
“message”: “Must provide a valid Client-ID or OAuth token”  
}

I tried on my linux machine to do the following and get the same response:

curl -H ‘Authorization: Bearer myclientid’ -X GET ‘[https://api.twitch.tv/helix/users?id=44322889](https://api.twitch.tv/helix/users?id=44322889)’

I’ve gone to my dashboard and triple checked my client id to make sure it’s correct. I’ve also tried using the Client ID of an entirely different project I had created years ago. What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [July 8, 2019, 9:03pm UTC](https://discuss.dev.twitch.com/t/error-on-retrieving-users-must-provide-a-valid-client-id-or-oauth-token/21750/2 "2019-07-08T21:03:47Z")

</div>

Bearer is for authorized keys not for clientID’s

For ClientID just send

> curl -H ‘Client-ID: myclientid’ -X GET ‘[https://api.twitch.tv/helix/users?id=44322889’](https://api.twitch.tv/helix/users?id=44322889%E2%80%99)

---

<div class="post-metadata">

**Author:** ![izikperz](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/izikperz/32/6675_2.png) [@izikperz](https://discuss.dev.twitch.com/u/izikperz)\
**Post date:** [July 8, 2019, 9:05pm UTC](https://discuss.dev.twitch.com/t/error-on-retrieving-users-must-provide-a-valid-client-id-or-oauth-token/21750/3 "2019-07-08T21:05:48Z")

</div>

Thank you so much. I spent way too long trying to figure that out. Maybe the documents should mention this…

---

<div class="post-metadata">

**Author:** ![Dist](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/dist/32/7192_2.png) [@Dist](https://discuss.dev.twitch.com/u/Dist)\
**Post date:** [July 8, 2019, 9:15pm UTC](https://discuss.dev.twitch.com/t/error-on-retrieving-users-must-provide-a-valid-client-id-or-oauth-token/21750/4 "2019-07-08T21:15:03Z")

</div>

> [@izikperz](#):
>
> Maybe the documents should mention this…

The Docs do explain this.

In the Getting Started section of the API docs [Twitch API | Twitch Developers](https://dev.twitch.tv/docs/api/) the second step shows how to use your Client ID to make requests.

Also in the Guide section of the API docs [Twitch API Concepts | Twitch Developers](https://dev.twitch.tv/docs/api/guide/#authentication) it explains authentication and how User Access and App Access tokens are sent in requests.

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [August 7, 2019, 9:21pm UTC](https://discuss.dev.twitch.com/t/error-on-retrieving-users-must-provide-a-valid-client-id-or-oauth-token/21750/5 "2019-08-07T21:21:37Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
