Google api Gmail:Ruby gem谷歌api客户端坏了?
没有人遇到过这种情况 我可以得到email消息对象(Google::api::GmailV1::message),但其他消息属性只返回Nil。仅返回id,线程\ idGoogle api Gmail:Ruby gem谷歌api客户端坏了?,google-api,rubygems,gmail,google-api-client,Google Api,Rubygems,Gmail,Google Api Client,没有人遇到过这种情况 我可以得到email消息对象(Google::api::GmailV1::message),但其他消息属性只返回Nil。仅返回id,线程\ id SCOPE = Google::Apis::GmailV1::AUTH_GMAIL_MODIFY service = Google::Apis::GmailV1::GmailService.new service.client_options.application_name = APPLICATION_NAME service
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
因此,基本上我确实获得了具有正确ID的电子邮件,但仅此而已,GmailV1::Message类的所有方法或属性都是Nil。我还尝试了修改范围,得到了相同的结果
仅返回Nil的属性:
还注意到,在他们的文档中链接的github项目在某些网站上打开了一个404页面。可能是因为谷歌现在强制开发者首先审查公开可用的应用程序:(见蓝色框中带星星的通知)