0

I have an api to get, create event and update event too.. for now i want to get push notification for if any attendee accepted the event request or rejected it or did any modification to it. so i did followed the link https://developers.google.com/calendar/v3/push and wrote my code as follow. Want to know if i am going wrong somewhere. Here user_email is my calenderId. Still i am getting 400 or 401 status response saying authorization error

            event_notification = {
                "id": event['id'],
                "type": "web_hook",
                "address": "http://www.example.com/notifications"
            }`enter code here`
            url = "https://www.googleapis.com/calendar/v3/calendars/"+user_email+"/events/watch"
            response = requests.post(url=url, data=json.dumps(event_notification), headers={"Content-Type":"application/json","Authorization":"I HAVE ENTERED THE ACCESS TOKEN OF CURRENT USER"})
Amrish Mishra
  • 180
  • 1
  • 12
  • You can check out this [SO post](https://stackoverflow.com/questions/40156523/google-calendar-api-push-notification-401-unauthorized-webhook-callback-chann) if there could be anything of help. The post contains suggestions on how to authorize webhooks. – Jacque Nov 28 '18 at 20:54
  • is it possible to get response using requests module or else i will have to use google byild for it? – Amrish Mishra Dec 02 '18 at 12:04

0 Answers0