This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Fetch JSON from the API. | |
*/ | |
function fetchLatestJson() { | |
var token = UserProperties.getProperty("fioApiToken"); | |
if (token === null) { | |
throw "Fio API Token not set. Please go to File > Project properties > User properties and create token fioApiToken."; | |
} | |
var response = UrlFetchApp.fetch("https://www.fio.cz/ib_api/rest/last/"+token+"/transactions.json"); | |
if (response.getResponseCode() !== 200) { |