# 401: Missing User OAUTH Token

**URL:** <https://discuss.dev.twitch.com/t/401-missing-user-oauth-token/29927>\
**Category:** API\
**Created:** [January 14, 2021, 8:55am UTC](https://discuss.dev.twitch.com/t/401-missing-user-oauth-token/29927 "2021-01-14T08:55:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shku](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/shku/32/11142_2.png) [@shku](https://discuss.dev.twitch.com/u/shku)\
**Post date:** [January 14, 2021, 8:55am UTC](https://discuss.dev.twitch.com/t/401-missing-user-oauth-token/29927/1 "2021-01-14T08:55:03Z")

</div>

I tried to get API responses with POSTMAN, but it did not work.  
It gets channel informations only.

## to get tokens

method: post  
url: [https://id.twitch.tv/oauth2/token](https://id.twitch.tv/oauth2/token)  
params:

- client\_id
- client\_secret
- grant\_type: client\_credentials
- scope: analytics:read:games

with this token, I tried to get any information with twitch API.

## to use API

method: get  
url: [https://api.twitch.tv/helix/analytics/games?first=5](https://api.twitch.tv/helix/analytics/games?first=5)  
headers:

- ![image](https://d2opxh93rbxzdn.cloudfront.net/original/2X/7/73f39f871da6eb5c40f84dfa01c1fd0d550cb665.png)  
response:  
401 Unauthorized: Missing User OAUTH Token

## to get channgel status

method: get  
url: [https://api.twitch.tv/helix/search/channels?query=test](https://api.twitch.tv/helix/search/channels?query=test)  
headers:

- Authorization: Bearer tokentokentoken
- client-id

response:  
get responses well

With same auth code, some works well.  
I have no idea with this problem… ☹  
My application scope is `analytics tool` in developers console.

Can anybody help me? 🥺

---

<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:** [January 14, 2021, 11:06am UTC](https://discuss.dev.twitch.com/t/401-missing-user-oauth-token/29927/2 "2021-01-14T11:06:49Z")

</div>

> [@shku](#):
>
> grant\_type: client\_credentials

That’s getting you an App Access Token. Not a User Access Token.

Any endpoint that requires a user to grant you permission to access it, such as the games analytics endpoint which requires a developer of that game to grant you permission to access their analytics, you MUST use either the [Implicit auth flow](https://dev.twitch.tv/docs/authentication/getting-tokens-oauth#oauth-implicit-code-flow) if you’re making requests client-side, or the [Auth Code flow](https://dev.twitch.tv/docs/authentication/getting-tokens-oauth#oauth-authorization-code-flow) if you’re making requests server-side.

Those 2 auth flows I mentioned send the user to Twitch where they can explicitly grant you permission to access that data, where as an App Access Token isn’t associated with any user and at no point involves a user granting access to anything so the scopes on it don’t do anything.

The reason your Get Channel Status request works okay is because that doesn’t require any user permissions, and is public data, so an App Access Token will work fine for that request.

---

<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:** [February 13, 2021, 11:06am UTC](https://discuss.dev.twitch.com/t/401-missing-user-oauth-token/29927/3 "2021-02-13T11:06:51Z")

</div>

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