head = {
‘client-id’:client_id,
‘Authorization Bearer’:token
}
Looking at it again it looks like instead of ‘Authorization Bearer’:token I should have added 'Bearer ’ to the beginning of the token string and just used ‘Authorization’:. I tried this as well, but to no avail. This time, however, I got a status 401 ‘invalid OAuth token’ reply.
I have registered a developer application at https://dev.twitch.tv/console, where I took the client id from and generated a few clients secrets that I have tried using with it, but none of these have worked. I’m not sure if my formatting is incorrect or if my token is bad. I would greatly appreciate any help that anyone has to offer.
thanks for the speedy reply. I tried that as well, but I ran into a slightly different issue of it returning ‘invalid OAuth token’. Is the way in which I got the OAuth token correct?
I have the space after ‘Bearer’. I just generated a new token using the https://dev.twitch.tv/console/apps and tried to get request the validate endpoint, but that also returned a status 401 indicating that the access token i just generated is invalid. Is there some reason that the secrets I just generated would be invalid?
head = {
'client-id':client_id,
'client_secret':client_secret,
'grant_type': 'client_credentials'
}
r = requests.post(API_ENDPOINT,headers = head)
Also there may be a typo in the docs. It says to use client_id in the header, but when i used that it said i was missing a client id. I also tried client-secret in the header, but that did not work.