0

Was any breaking change made by Google on GMail API on 11th April, 2020 ?

We have a ruby web application which also has a Chrome extension. (pretty old, ruby 2.1.0) which uses google-api-client version 0.6.4 and was working great so far, but then since April 11, the app stopped working in a way that all the call to GMail APIs are failing with 404 error.

To give a clue, we have a library from where we call google client to perform actions, something like this:

def thread_metadata(id)
@metadata ||= execute(gmail_api.users.threads.get,
  {
    'collection' => 'public',
    'userId' => 'me',
    'id' => id,
    'format' => 'metadata',
    'metadataHeaders' => 'Subject'
  }
)

However, the response which we get from Google is 404 with a message something like this:

he requested URL /discovery/v1/apis/gmail/v1/gmail/v1/users/me/threads/16365500056684b0?collection=public&format=full was not found on this server. That’s all we know.

I don't have any clue what has gone wrong except that the 404 error which started coming in suddenly since April 11.

anothermh
  • 9,815
  • 3
  • 33
  • 52
indevruby
  • 49
  • 1
  • 1
  • 2
  • 1
    Please edit your question include a https://stackoverflow.com/help/minimal-reproducible-example and the full error message. there is not enough code here to reproduces the issue. sounds like you have an invalid thread id. I dont know that library but this looks strange to me gmail/v1/gmail/v1/ – Linda Lawton - DaImTo Apr 15 '20 at 12:14
  • https://developers.google.com/gmail/api/release-notes <-- gmail release notes – Linda Lawton - DaImTo Apr 15 '20 at 12:15

1 Answers1

0

You'll need to update your google-api-client gem, as of v0.8.6 they changed where the baseUrl is to make requests. Presumably the path the old gems were still using remained unchanged until recently.

The method_base used to generate the URI returns something different pre-0.8.6:

irb(main):046:0> gmail_api.method_base
=> #<Addressable::URI:0x3ff4ff4e319c URI:https://www.googleapis.com/discovery/v1/apis/gmail/v1/rest>

In 0.8.6+:

irb(main):009:0> gmail_api.method_base
=> #<Addressable::URI:0x3ff97faf4610 URI:https://www.googleapis.com/>
kwong-yw
  • 51
  • 5