# Getting OAuth token for newly registered Twitch Application (Chat Bot)

**URL:** <https://discuss.dev.twitch.com/t/getting-oauth-token-for-newly-registered-twitch-application-chat-bot/9745>\
**Category:** API\
**Created:** [March 23, 2017, 8:09pm UTC](https://discuss.dev.twitch.com/t/getting-oauth-token-for-newly-registered-twitch-application-chat-bot/9745 "2017-03-23T20:09:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevdnv](https://avatars.discourse-cdn.com/v4/letter/k/f19dbf/32.png) [@kevdnv](https://discuss.dev.twitch.com/u/kevdnv)\
**Post date:** [March 23, 2017, 8:09pm UTC](https://discuss.dev.twitch.com/t/getting-oauth-token-for-newly-registered-twitch-application-chat-bot/9745/1 "2017-03-23T20:09:47Z")

</div>

Hello, I’m having issues getting the required editor scope for my chat bot to update stream information for users. When I first started working on the bot, I used an OAuth token from [here](https://twitchapps.com/tmi/). I registered my application today on Twitch to generate a client id which I believe is required for updating stream information. Using my previous OAuth token when trying to update a stream’s title doesn’t work and I haven’t found a way to get a new OAuth token that will work with my application yet.

I attempted to authorize my new app to access my channel information with the channel editor scope.

```
https://api.twitch.tv/kraken/oauth2/authorize?response_type=token&client_id=CLIENT_ID&redirect_uri=REDIRECT_URI&scope=channel_editor

```

Trying to update the title afterwards

```
https://api.twitch.tv/kraken/channels/CHANNEL?channel[status]=TEST_TITLE&_method=put&client_id=NEW_CLIENT_ID&oauth_token=OLD_TWITCH_OAUTH

```

which just gives an error

```
{"error":"Unauthorized","status":401,"message":"Token invalid or missing required scope"}

```

Any help with this would be greatly appreciated. Thank you.

---

<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:** [March 23, 2017, 8:40pm UTC](https://discuss.dev.twitch.com/t/getting-oauth-token-for-newly-registered-twitch-application-chat-bot/9745/2 "2017-03-23T20:40:34Z")

</div>

The OAuth generated from that link you posted will only have the scope to connect to chat, which is why it lacks the channel\_editor scope. You need to use the OAuth token that you get from the request that has the channel\_editor scope.

---

<div class="post-metadata">

**Author:** ![kevdnv](https://avatars.discourse-cdn.com/v4/letter/k/f19dbf/32.png) [@kevdnv](https://discuss.dev.twitch.com/u/kevdnv)\
**Post date:** [March 23, 2017, 9:51pm UTC](https://discuss.dev.twitch.com/t/getting-oauth-token-for-newly-registered-twitch-application-chat-bot/9745/3 "2017-03-23T21:51:02Z")

</div>

Thank you!

---

<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:** [April 22, 2017, 9:55pm UTC](https://discuss.dev.twitch.com/t/getting-oauth-token-for-newly-registered-twitch-application-chat-bot/9745/4 "2017-04-22T21:55:21Z")

</div>

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