$data = array();
  $httpClient = new Zend_Gdata_HttpClient();
  $access_token = getAccessToken($request_token);

  // Query the Documents API
===================================================
  $feedUri = 'http://docs.google.com/feeds/documents/private/full';
  $params = array(
    'max-results' => 50,
    'strict' => 'true'
  );
  $req = OAuthRequest::from_consumer_and_token($consumer,
$access_token,
                                               'GET', $feedUri,
$params);
  $req->sign_request($sig_method, $consumer, $access_token);

  // Note: the Authorization header changes with each request
  $httpClient->setHeaders($req->to_header());
  $docsService = new Zend_Gdata_Docs($httpClient);

  $query = $feedUri . '?' . implode_assoc('=', '&', $params);
  $feed = $docsService->getDocumentListFeed($query);


  // Query the Calendar API
================================================


  $feedUri = 'http://www.google.com/calendar/feeds/default/
allcalendars/full';


  $req = OAuthRequest::from_consumer_and_token($consumer,
$access_token, 'GET',
                                               $feedUri, $params);

  $req->sign_request($sig_method, $consumer, $access_token);

  // Note: the Authorization header changes with each request
  $httpClient->setHeaders($req->to_header());
  $calendarService = new Zend_Gdata_Calendar($httpClient);

    $calendarService->getCalendarListFeed();

//-----------------------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------------------
It works with Documents API ,Spreadsheets, and others , but with
Calendar API shows the error:

Unknown authorization header
Error 401
Can anyone help me please.
Or show me other way to connect me to Calendar Api, with Oauth (PHP or
JS)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Calendar Data API" group.
To post to this group, send email to 
[email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to