3

I am trying to search gmail api with custom header (this case it is named notification-id), but it does not work. Request I am making:

GET https://www.googleapis.com/gmail/v1/users/tme/messages?includeSpamTrash=true&q=notification-id%3A560d01cef318893c3c000016

I tried the same query using default header (rfc822msgid) from google mail api and it works with this request: GET https://www.googleapis.com/gmail/v1/users/me/messages?includeSpamTrash=true&q=rfc822msgid%3A560d01d068c_6690c6f31857290%40ip-172-31-12-127.mail

Any ideas why it does not work with custom header?

1 Answers1

5

I tried to do this myself a while back, and came to the conclusion that it was not possible. Someone please correct me if I'm wrong.

According to the Advanced search-documentation, you can search for the following headers:

  • from, to, subject
  • list:

Messages with the words info@example.com in the headers, sent to or from this list

  • deliveredto:

Any message with username@gmail.com in the Delivered-To: field of the message header (which can help you find messages forwarded from another account or ones sent to an alias).

  • rfc822msgid:

Locates the exact message with the specified SMTP message-id.

Tholle
  • 108,070
  • 19
  • 198
  • 189