Januka samaranyake Januka samaranyake - 1 month ago 5
Python Question

Gmail push notifications does not stop

I am connecting my email to pub/sub API using "WATCH" requset. But when I going to stop notifications using below code(provided by Google) it doesn't work. I am using python client.

credentials = get_credentials()
http = credentials.authorize(httplib2.Http())
service = discovery.build('gmail', 'v1', http=http)
result = service.users().stop(userId='me')


My references:

https://developers.google.com/gmail/api/guides/push

Answer
result = service.users().stop(userId='me').execute()

you forgot execute method, until and unless you call execute method, your statements do nothing.