I work with the Google Drive API but the principle is the same.
You need to not just look at the status code but also the response data returned. Here is an example of a Bad
(Google Drive) Request
POST https://www.googleapis.com/oauth2/v4/token HTTP/1.1
and google's response data
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=UTF-8
Date: Tue, 07 Mar 2017 06:02:05 GMT
Expires: Tue, 07 Mar 2017 06:02:05 GMT
Cache-Control: private, max-age=0
X-XSS-Protection: 1; mode=block
Alt-Svc: quic=":443"; ma=2592000; v="36,35,34"
"error_description": "Missing required parameter: refresh_token"
This is the API page for the endpoint that you are calling: Events: watch | Google Calendar API | Google Developers
The document states that the request is a Json packet:
In the request body, supply data with the following structure:
Your data is in the incorrect form. So you are correctly receiving the Parse Error
re: Authorization Error
You need to Authenticate first, to gain access to your private data, before you can post changes. Authentication is more than the code that you have provided for your problem. You need to complete the steps in the following link:
Once you have resolved the Authorization Error, then you can try creating your webhook.