I have a small script to pull information from a Trello API.
The script works fine when I've assigned the full URL to a String variable. However, when I pass the params separately, I get an error "unauthorized permission requested".
Working code:
var url = "https://api.trello.com/1/boards/57c68c1beaab4c676adfaeb1/lists?key=myTrelloKey&token=myTrelloToken";
var response = UrlFetchApp.fetch(url);
Logger.log(response.getContentText());
Problematic code:
var url = "https://api.trello.com/1/boards/57c68c1beaab4c676adfaeb1/lists";
var options =
{
"key": "myTrelloKey",
"token": "myTrelloToken",
"muteHttpExceptions" : true
};
var response = UrlFetchApp.fetch(url,options);
Logger.log(response.getContentText());
I have tried to understand if it's an Authentication issue, but could not get my way around it. Am I doing something wrong in the second version? Thanks in advance!