You have sent data such as:
title=Netsuite%20List
But the Google API is waiting for JSON :
{ "title": "Netsuite List" }
Try providing JSON.stringify() output in the requestURL method:
postData = JSON.stringify({'title':'Netsuite List'}); // <-- Added JSON.stringify access_token = 'xxxx'; url = 'https://www.googleapis.com/tasks/v1/users/@me/lists'; headers['Content-type'] = 'application/json'; headers['Authorization'] = 'Bearer ' + access_token; headers['Content-length'] = 25; response = $$.requestURL(url, postData, headers, 'POST');
Also, itβs best to go around the documentation or source of the $$ object you are using and see how it can support sending JSON data.
source share