Categories
API Development

Gmail API can’t publish any message to Pub/Sub platform

I have set everything up in the GCP. And my server can receive the message, after I manually published a message.
enter image description here
But the question is: when I send an e-mail to the e-mail account, there is no any notification in Pub-Sub system and my webhook sever !

Below graph is the proof that my server can receive the message, after I manually published a message.

enter image description here

enter image description here

enter image description here

enter image description here

And as the graph above, when I call the list history API, I can check there is the test mail information I just sent.

Besides, I have successfully called the watch API, and it returned:

{'historyId': '7688', 'expiration': '1574928158379'}

Here is my watch call:

In [9]:     def set_watch(self, topicName):
   ...:         request = {
   ...:             'labelIds': ['INBOX', 'UNREAD', 'STARRED'],
   ...:             'labelFilterAction': 'include',
   ...:             #'labelIds': ['UNREAD'],
   ...:             'topicName': topicName
   ...:         }
   ...:         res = self.service.users().watch(
   ...:             userId=self.userId, body=request).execute()
   ...:         print(res)

Leave a Reply

Your email address will not be published. Required fields are marked *