KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm trying to use the Google API v3 to access one google calendar and according to the documentation here : http://code.google.com/apis/calendar/v3/using.html#intro and here : https://code.google.com/apis/console/ , the solution I need is the "Simple API Access" & "Key for server apps (with IP locking)". Now, when I create a page with this code : session_start(); require_once 'fnc/google-api-php-client/src/apiClient.php'; require_once 'fnc/google-api-php-client/src/contrib/apiCalendarService.php'; $apiClient = new apiClient(); $apiClient->setUseObjects(true); $service = new apiCalendarService($apiClient); if (isset($_SESSION['oauth_access_token'])) {$apiClient->setAccessToken($_SESSION['oauth_access_token']); } else { $token = $apiClient->authenticate(); $_SESSION['oauth_access_token'] = $token; } and in my "config.php" file I add ONLY my developper key (in place of the "X") : global $apiConfig; $apiConfig = array( // True if objects should be returned by the service classes. // False if associative arrays should be returned (default behavior). 'use_objects' => false, // The application_name is included in the User-Agent HTTP header. 'application_name' => '', // OAuth2 Settings, you can get these keys at https://code.google.com/apis/console 'oauth2_client_id' => '', 'oauth2_client_secret' => '', 'oauth2_redirect_uri' => '', // The developer key, you get this at https://code.google.com/apis/console 'developer_key' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX', // OAuth1 Settings. // If you're using the apiOAuth auth class, it will use these values for the oauth consumer key and secret. // See http://code.google.com/apis/accounts/docs/RegistrationForWebAppsAuto.
Tags (comma-separated)
Save Edits
Cancel