POST https://www.googleapis.com/calendar/v3/calendars/XXX%40gmail.com/events/watch?key={YOUR_API_KEY} Content-Type: application/json Authorization: Bearer ya29.AHES6ZSNBYiHYPu6Y1_5P08hdb-EX5pdF4Ygj5ou_RKp_jOCS5beiDDH X-JavaScript-User-Agent: Google APIs Explorer
"id": "01234567-89ab-cdef-0123456789ab","type": "web_hook","token": "token=123546"}Response401 Unauthorizedcache-control: private, max-age=0 content-encoding: gzip content-length: 188 content-type: application/json; charset=UTF-8 date: Thu, 17 Oct 2013 12:49:00 GMT expires: Thu, 17 Oct 2013 12:49:00 GMT server: GSE www-authenticate: Bearer realm="https://www.google.com/accounts/AuthSubRequest", error=invalid_token"domain": "global","reason": "push.webhookUrlUnauthorized","message": "Unauthorized WebHook callback channel: https://www.example.com/WebHook/Index"}],"code": 401,"message": "Unauthorized WebHook callback channel: https://www.example.com/WebHook/Index"}}I have already whitelisted my domain www.example.comI googled about this issue , but could not find much help.can anybody guide, whats wrong with request ?
when you try with API Explorer,it will not use your OAuth2.0 project keys where you have registerd whitelisted domains, maybe it would use another keys
try to use client/lib
Finally It worked for me , cause of error "Unauthorized WebHook callback channel" was in Configuration of Project in
Happy coding :)
www-authenticate: Bearer realm="https://accounts.google.com/AuthSubRequest", error=invalid_token