Skip to content

Sending authenticated API requests

Oliver Schlöbe edited this page Jun 4, 2019 · 2 revisions

The RBTV OAuth 2.0 provider provides a way to get an authenticated API request for the service, using the access token; it returns an object conforming to Psr\Http\Message\RequestInterface.

$subscriptionsRequest = $rbtvProvider->getAuthenticatedRequest(
	'GET',
	'https://api.rocketbeans.tv/v1/subscription/mysubscriptions', // see https://github.com/rocketbeans/rbtv-apidoc#list-all-subscriptions
	$accessToken
);

// Get parsed response of current authenticated user's subscriptions; returns array|mixed
$mySubscriptions = $rbtvProvider->getParsedResponse($subscriptionsRequest);

var_dump($mySubscriptions);
Clone this wiki locally