PHP Gmail API doesn't fetch emails

I use the PHP google api with OAuth2.

ALL the process of the token procees has been successfuly completed.

I use the scopes:

$a_scopes = array(
                  Google_Service_Oauth2::USERINFO_EMAIL,                                                                       
                  Google_Service_Oauth2::PLUS_ME,
                  'https://mail.google.com/mail/feed/atom'                           
                 );

$this->client->setScopes($a_scopes);

I use the code to retrieve the emails:

$plus = new Google_Service_Plus($this->client);
$person = $plus->people->get('me');
$user = $person->getEmails();

echo("<pre>");var_dump($user);die("</pre>");

The result:

array(1) {
   [0]=>
   object(Google_Service_Plus_PersonEmails)#29 (4) {
      ["type"]=>
      string(7) "account"
      ["value"]=>
      string(17) <My Email>
      ["modelData":protected]=>
          array(0) {
          }
      ["processed":protected]=>
          array(0) {
          }
   }
}

Answers


I don't think that the atom feed is a defined scope for the API. The documentation only defines the basic: Modify, ReadOnly and Compose scopes. The Atom Feed only shows you unread messages, and even then only shows snippets of the message.

To fix your issue you need to define your scope as one of those defined by the Gmail API


Need Your Help

Valgrind memcheck result analysis of a bison/flex parser

c++ memory valgrind

I am running memcheck on my program and i'm trying to solve the memory issues.

Convert DataGrid cell content

wpf data-binding datagrid datatable converter

I have a DataGrid whose ItemsSource is set to a DataTable. The DataTable has a column of type DateTime, and I would like to display informational text (ie. "N/A") if the date in a particular cell i...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.