404 response of api

import requests
import json


get_user_request = requests.get('https://api.twitch.tv/helix/users?id=707412998', headers={'Authorization': 'Bearer REMOVED', 'Client-Id': 'kimne78kx3ncx6brgo4mv6wki5h1ko', "Accept": "application/vnd.twitchtv.v5+json"})

print(get_user_request.json())

I tried changing api versions and users/login param, it didn’t help

Don’t ever leak access tokens. Also, do NOT use first party OAuth tokens. That Client ID does not belong to you so you should not be using their tokens.

Go through the OAuth process as documented in the Authentication docs and create your own app, and get the tokens you need there.

You don’t need to send that header as v5 doesn’t exist any more, and Helix doesn’t even use that header or version numbering.

I don’t understand how to get a user token
do I need to create an application?

Yes

For “regular” User Tokens: (response_type = code)

  • Create a web page that has a <a href link with the needed scopes
  • Send the user you need a token for to that page
  • User clicks the link
  • User goes to twitch and acepts (or declines) the link between their Twitch account and yoru ClientID
  • User comes back to your site with a ?code in the query string parameters
  • Your site exchange the ?code for an access and refresh token.

thanks to everyone, I’ll try

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