anuj607 / google-api-php-client

Automatically exported from code.google.com/p/google-api-php-client
Apache License 2.0
0 stars 0 forks source link

Provide me a sample #92

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

Please provide me a sample of instantiating a client using just the API key 
(not the OAuth 2.0 token) in PHP.

thanks,
Laura Young

Original issue reported on code.google.com by laurarad...@gmail.com on 1 Mar 2012 at 9:03

GoogleCodeExporter commented 9 years ago
Here's the sample:

<?
require_once 'google-api-php-client/src/apiClient.php';
require_once 'google-api-php-client/src/contrib/apiPlusService.php';
session_start();

$client = new apiClient();
$client->setApplicationName('Google+ PHP Starter Application');
// Visit https://code.google.com/apis/console?api=plus to generate your
// simple api key
$client->setDeveloperKey('insert_your_simple_api_key');
$plus = new apiPlusService($client);

 $activities = $plus->activities->listActivities('118051310819094153327', 'public');
 print 'Activities: <pre>' . print_r($activities, true) . '</pre>';

Original comment by chirags@google.com on 4 Mar 2012 at 1:51

GoogleCodeExporter commented 9 years ago
Hi,

Thank you for the code sample; however, I should have been more specific. I 
need to interface with Google Calendar. Can you provide a similar code sample; 
however, one that interfaces with Google Calendar?

Thanks much.
Laura Young

Original comment by laurarad...@gmail.com on 5 Mar 2012 at 4:29