Hi Barry,
I still have an important question and I hope you can help me.
Do I have to get a new token here https://id.twitch.tv/oauth2/token (start new call) every time I query https://api.twitch.tv/helix/subscriptions? Or can i only use the token from login via https://id.twitch.tv/oauth2/token from database? Can I call https://api.twitch.tv/helix/subscriptions again and again until the token has expired?
I am asking because I am now getting a 401 error. When I call https://api.twitch.tv/helix/subscriptions from the broadcaster with the token and ClientID.
My Code:
$curl = curl_init('https://api.twitch.tv/helix/subscriptions?broadcaster_id='.$broadcasterClientID);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Client-ID: ' . $broadcasterClientID,
'Authorization: Bearer ' . $broadcasterToken
));
curl_setopt($curl, CURLOPT_TIMEOUT, 1000);
Many Thanks!