I’m using the PHP authentication examples from TwitchDev’s Github account.
I can’t figure out how to output the results of API requests in any way. The example uses
// You can now create authenticated API requests through the provider.
//$request = $provider->getAuthenticatedRequest(
// 'GET',
// 'https://api.twitch.tv/kraken/user',
// $accessToken
//);
but how do I then access that output? I can’t just use echo nor can I put it into an array like the example of getResourceOwner()
// Using the access token, get user profile
$resourceOwner = $provider->getResourceOwner($accessToken);
$user = $resourceOwner->toArray();
echo '<tr><th>Username</th><td>' . htmlspecialchars($user['display_name']) . '</td></tr>';
and simply modify based on what the array should contain, based on API documentation.
How does getAuthenticatedRequest() work?