Hello,
for my project, I need to recover the information of the user, as well as that of the subscriber. Here is the request to recover this information.
$this->_headers = [
'Authorization: Bearer '.$token,
'Accept: application/vnd.twitchtv.v5+json',
'Client-Id: '.$this->_client_id
];
$link = "https://api.twitch.tv/helix/users";
$ch = curl_init($link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $this->_headers);
$res = curl_exec($ch);
curl_close($ch);
if(strpos($res, "data")){
return json_decode($res);
}else{
return $res;
}
The problem is that this query does not give me as much information as a search with the id like this query
$link = "https://api.twitch.tv/kraken/users/".$id."/follows/channels";
$ch = curl_init($link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $this->_headers);
$res = curl_exec($ch);
curl_close($ch);
if(strpos($res, "_total")){
return json_decode($res);
}else{
return $res;
}
is there a way to get all this information without making two requests to the api?
thank you for your reply,
Jesver