I am trying to use googles API, which you can only used when authenticated with oAuth.
I have successfully obtained the access key, however I can't seem to be able to use it with the API. This is my code:
$accessToken = $client->fetchAccessTokenWithAuthCode($_GET["code"])["access_token"];
$ch = curl_init();
$url = "https://www.googleapis.com/androidpublisher/v2/applications/flarehubpe.flarehub.xflare/purchases/products/flarehubvip/tokens/fraud_token";
$headers = array("Authorization: Bearer $accessToken");
curl_setopt($ch, CURLOPT_URL, $url); # URL to post to
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 ); # return into avariable
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); # custom headers, see above
$result = curl_exec($ch); # run!
curl_close($ch);
var_dump("Result", $result);
//Outputs: "result" nothing else.
What am I doing wrong?