gem 'google-api-client', '~> 0.7.1'
using ruby google client to call https://developers.google.com/gmail/api/v1/reference/users/messages/attachments/get it is crashing after i get the result and call result.data
result.rb line 154
data = @request.api_method.response_schema.new(data)
throws JSON::ParseError
757: unexpected token at '"R0lGODlhigKjAOYAAG2Xd9js18jkx........="'
The data field of the attachment is base64 encoded, if you want to access the data field, you should decode it first.
For example you can do the following:
Or try:
You might also want to read this article about how to parse json correctlu.