0
votes

Nobody has encountered this?

I can get the email message object (Google::Apis::GmailV1::Message) but other Message attributes just returns Nil. Only id, thread_id seems to be returned.

SCOPE = Google::Apis::GmailV1::AUTH_GMAIL_MODIFY

service = Google::Apis::GmailV1::GmailService.new
service.client_options.application_name = APPLICATION_NAME
service.authorization = authorize

user_msgs = service.list_user_messages('me', 
    {:include_spam_trash => false, :label_ids => ['INBOX'], :q => "is:unread"})

user_msgs.messages.each do |msg|
   puts "CLASS: #{msg.class}"   # Google::Apis::GmailV1::Message
   puts "MESSAGE ID: #{msg.id}"  # WORKS I get the email ID
   msg_part = msg.payload
   puts "MSGPART: #{msg_part.class}" # NIL !!!, All other attributes are also NIL
end

So basically I do get the email with the correct ID, but that's about it, all methods or attributes of the GmailV1::Message class is Nil. I also tried changing the SCOPE to MODIFY and same result.

Attributes that just returns Nil:

  • internal_date
  • label_ids
  • payload
  • raw
  • size_estimate
  • snippet
  • Also noticed that github project linked in their documentation opens a 404 page on some.

    1

    1 Answers

    0
    votes

    Might be due to Google now forcing developers to have publicly available apps reviewed first: https://developers.google.com/gmail/api/auth/about-auth (see the notification in the blue box with the star)