Januka samaranyake Januka samaranyake - 11 months ago 60
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:


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

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