Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Watch request in gmail API doesn't work

I am trying to make a watch request using python as referred to in the google APIs but it does not work.

request = {
  'labelIds': ['INBOX'],
  'topicName': 'projects/myproject/topics/mytopic'
}
gmail.users().watch(userId='me', body=request).execute()

I could not find a library or a package to use gmail.users() function. How do I make a watch request using an access token?

like image 907
Januka samaranyake Avatar asked Oct 18 '22 00:10

Januka samaranyake


1 Answers

Do it in gmail python client(provide by google).under main function

request = {
        'labelIds': ['INBOX'],
        'topicName': 'projects/myprojects/topics/getTopic'
    }
    print(service.users().watch(userId='me', body=request).execute())
like image 160
Januka samaranyake Avatar answered Oct 28 '22 21:10

Januka samaranyake