Api.twitch.tv/helix/streams?first=10 returns 404 not found

  • Get Streams doesn’t take any scopes
  • Client Credentials tokens can’t have scopes

Looks like you want a call along the lines of

  response = UrlFetchApp.fetch('https://api.twitch.tv/helix/streams?first=10', {
    'method' : 'get',
    'headers' : {
      'Client-ID': client_id,
      'Authorization': 'Bearer ' + access_token
    },
    'muteHttpExceptions': true
  );
  console.log(response.getContentText());

So the options you were passing to URLFetch are wrong.

You tried a send a payload which for this library is for POST BODY data, which might have caused Google’s URLFetch to auto convert from a GET request to a POST request, hence the 404 as you cannot POST to Get Streams.

1 Like