So I’ve searched through this forum quite a lot and I am at my wits end. I’m simply trying to get a the name of a game after retrieving it’s id. So I’ve read, that the API call:
https://api.twitch.tv/helix/games?id=
will return the game name in the body. This however doesn’t really work because it tells me, that the oauth and the clientID don’t match. I don’t know why, because every other call works just fine.
I try to get the game name via request:
return request({
baseUrl: ‘https://api.twitch.tv/helix/games?id=’ + gameid,
url: ‘channel’,
method: ‘GET’,
headers: {
Accept: ‘application/vnd.twitchtv.v5+json’,
Authorization: 'Bearer ’ + access_token,
‘Client-ID’: clientID
},
json: true
},
(err, { statusCode }, body) => {
if(err)
console.log(err);
else if(statusCode !== 200){
console.log({ statusCode, body });
}
else{
/* do stuff with the game name */
}
});
What am I doing wrong here?