0

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) {
          }
   }
}

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.