Server to Server Endpoint request unauthorised

Hi, Thanks for the help so far.

Im live working on the code while I was waiting for a reply. Here is the code with the changes.


async function RequestStreams() {

  got({

    url: "https://api.twitch.tv/helix/channels?broadcaster_id=44445592",

    method: "GET",

    headers: {

      'Content-Type': 'application/json',

      'Client-ID': TwitchClientID,

      'Authorization': `Bearer `+ accessToken

    },

    responseType: "json"

}).then(resp => {

  console.log("Ok", resp.body);

  if (resp.body.expires_in <= 3600) {

      twitch.makeClientCred();

  } else {

      // it"s ok

  }

}).catch(err => {

  console.log('Error Time!')

  console.error(err);

});

}

Still getting the same error though