-1

I'am trying to retrieve some data from Klipfolio and put it in a Google Spreadsheet. I'am using Google Apps Script to accomplish this, but I get this error:

Errorcode: 401. {"meta:{"success":false,"status":401,"error_code":"auth_not_provided","error_desc":"This operation requires authentication"}}

this is my code:

function output() {
  var url = "https://app.klipfolio.com/api/1.0/klips/db88d343e7eeef916f9541d73f0df58c/schema/";
  var response = UrlFetchApp.fetch(url);
  var json = response.getContentText();
  var data = JSON.parse(json);
  return data;
}

I hope you can help me...

M Reza
  • 18,350
  • 14
  • 66
  • 71
geartzen9
  • 27
  • 7
  • Well, based on that "authentication failure" error, you need to send authentication. Your request shows no special headers, so I suggest reviewing your API documentation and then reviewing the Apps Script documentation for `UrlFetchApp` to determine how you can send it properly. – tehhowch May 02 '18 at 12:54

1 Answers1

0

You need to use your klipfolio username and password in your request. Here is a StackOverflow post detailing how to do that:

How to use UrlFetchApp with credentials? Google Scripts