Hi there,
I got the service account example using the Prediction API to work, but I don't really know how to adapt the example to access Fusion Tables. Is there an example? And if there is not, what is the easiest way to just retrieve the access_token? I tried something like that:
$client = new apiClient();
$client->setClientId(CLIENT_ID);
$client->setScopes('https://www.googleapis.com/auth/fusiontables');
//add key
$key = file_get_contents(KEY_FILE);
$client->setAssertionCredentials(new apiAssertionCredentials(
SERVICE_ACCOUNT_NAME,
array('https://accounts.google.com/o/oauth2/token'),
$key)
);
$client->authenticate();print $client->getAccessToken();
Am I on the right track? With this code I get an error about a missing "redirect_uri", but I don't think I need that parameter for a service account, so probably my request is wrong. Any help appreciated.
Regards Stefan