Note that there are some explanatory texts on larger screens.

plurals
  1. POZend Gdata and Gmail Feed Access with Oauth
    text
    copied!<p>In Zend Gdata modules there is own classes for Docs and Calendar, but not any for Gmail. Do you know any working examples?</p> <p>Because I cant get gmail work myself. I get tokens from Oauth with ease and libraries that Zend does provide work flawlessy, like Zend_Gdata_Docs.</p> <p>I just prove my point:</p> <pre><code>$token = unserialize($this-&gt;user-&gt;google_token); $httpClient = $token-&gt;getHttpClient($google_oauth_config); $client = new Zend_Gdata_Docs($httpClient); // Retrieve user's list of Google Docs $feed = $client-&gt;getDocumentListFeed(); foreach( $feed-&gt;entries as $entry ) { $docs[] = $entry; } </code></pre> <p>And I get docs like i should.</p> <p>But how to get emails? There's no ready client for it, so i tried just force request to the right endpoint:</p> <pre><code>$token = unserialize($this-&gt;user-&gt;google_token); $httpClient = $token-&gt;getHttpClient($google_oauth_config); $httpClient-&gt;setUri("https://mail.google.com/mail/feed/atom"); $response = $httpClient-&gt;request(); </code></pre> <p>But accessing it directly like that seems to broke something / or something does not get done. Google says me that 401 unauhtorized access.</p> <p>To narrow the problem more, i changed my working docs code so, that i set URI manually and then do the same direct request() (i don't use that Gdata_Docs class at all) and it also fires error in Google's end. So the problem seems to be in that direct request.</p> <p>If anyone could have any helpful input what should be done, i'd be more than grateful! Or do i need to create new class, extending Gdata and try it that way? It's all that i can come up with.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload