0

I am getting error as

"success":false, "error":"You need to be authorized to make this request.",

Below is the code I have written

function post_phone() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var ph = ss.getRange('E5').getValue();

var url = 'http://someurl/processdata.php';

 var payload =
      { 
     phone : ph

   };


var options =
 {
 "method": 'POST',
 "payload": payload
 };

  var response = UrlFetchApp.fetch(url, options);

  Logger.log(response);


}
Stacy Thompson
  • 688
  • 1
  • 10
  • 26
  • 1
    well you haven't specified your url domain. does it need authorization? – Sujay Phadke Feb 05 '17 at 06:23
  • Following up on what @Sujay said, may be you need an authorization to call the url. Check this related SO post - [How to use UrlFetchApp with credentials? Google Scripts](http://stackoverflow.com/a/23718759/5995040), this post summarized the basic call with authorization. Hope this helps. – Mr.Rebot Feb 05 '17 at 08:17
  • I realise that this may seem 2 years too late but are you still experiencing any issues? – Sourabh Choraria Oct 28 '19 at 14:56
  • @SourabhChoraria no, i doesn't remember what I was doing back then :) – Stacy Thompson Oct 28 '19 at 18:23

0 Answers0