Get Message Without History From Gmail API

2019-04-12 05:11发布

问题:

I'm using the Gmail RESTful API directly (not from some library). Looking at the documentation here Gmail Documentation.

I have managed to get the content of the message body, however it also returns the whole history chain for the current message.

Is there a way to get a response from the API only the requested message body, without the whole thread history?

回答1:

According to this thread, it is not possible because it is part of the email's body content and you're specifying the ID of the message to retrieve.

You are getting the full reply message. When the report replied, they quoted the original message and this the text of the original is in the reply message. You may just want to do what Gmail and many other modern emails apps do and collapse/hide any reply text which begins with >.

References:

  • How to get the reply message without the original message from the Gmail API
  • GMAIL API : How to get the reply without the original message
  • Most efficient way to get new messages