Google url Shortning API call with Deluge

Google url Shortning API call with Deluge

I am attempting to shorten an url using the Google url Shortning API. However the scripting is returning an error

Below is how I have scripted the API call in deluge:

headerMap = {"Content-type" : "application/json"};
requestBody = {"longUrl":"http://www.google.com"};
response11 = postUrl("https://www.googleapis.com/urlshortener/v1/url?key=AIzaSyCXSvaYtT2Yr3TxKcesN9OU2FXNVvzM3tQ",requestBody , headerMap,false);

Here is the error return in the response:

{"responseCode":"400","responseText":"The request had bad syntax or was inherently impossible to be satisfied."}


Any help in resolving this issue would be greatly appreciated.