Getting Response Error 500

I’m trying to set stream title, going as follows:

#Get access token
url = "https://api.twitch.tv/kraken/oauth2/token?client_id="+CLIENT_ID+"&client_secret=MY_CLIENT_SECRET&grant_type=client_credentials&scope=user:edit"
req = requests.post(url)

#Send request using token
url = "https://api.twitch.tv/kraken/channels/mychannel/"
headers = {"Client-ID" : ""+CLIENT_ID +"", 
			"Accept" : "application/vnd.twitchtv.v5+json", 
			"Authorization" : "OAuth "+json.loads(req.text)['access_token'],
			"Content-Type": "application/json"
			}

data = {"channel": {"status": tmp, "channel_feed_enabled": 'true'}}
resp = requests.put(url=url, data=data, headers=headers)
    print(resp) //prints <Response[500]>

I don’t get what I’m doing wrong. Already tried withNew Twitch API changing OAuth with Bearer with no success. Can someone explain me what’s going on?

You’re calling a v5 endpoint with a token using Helix’s scopes. See the scopes for Twitch API v5 and documentation for /kraken/channels/<channel ID>. You’ll also need a user access token.

So, I first need to change:

...&scope=channel_editor"

Then, I need to request a user access token, but how do I get that?

Implicit code flow or Authorization code flow, depending on your application. See getting tokens.

So I need to use the user access token only, am I right?

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