I am stuck on this API thing. I want to print the incoming json file (channel points in specific) but it just prints the whole page in html format. Here is my code:
import requests
import json
client_id = secret
oauth_token = secret
my_uri = 'https://localhost'
header = {"Authorization": f"Bearer {oauth_token}"}
url = f'https://id.twitch.tv/oauth2/authorize?client_id={client_id}&redirect_uri={my_uri}&response_type=id_token&scope=channel:read:redemptions+openid&state=c3ab8aa609ea11e793ae92361f002671&claims={"id_token":{"email_verified":null}}'
response = requests.get(url, headers=header)
print(response.text)
My hypothesis is that either the url
or the header
is the problem. The twitch API is made for c# or js originally but I don't know how to convert that information to python.
I would also like to know how to do the "PING" and "PONG" thing that Twitch is writing about in the API