Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Read data from a public Json data store so you can maintain state between several script runs
function main() {
// Enter your own URI here, the same one you used when writing your data
var MyJsonBin = 'https://api.myjson.com/bins/l46me';
var options = {
method:"get",
};
var response = UrlFetchApp.fetch(MyJsonBin, options);
var tokens = JSON.parse(response.getContentText());
var uri = tokens['uri'];
for(var key in tokens) {
var val = tokens[key];
Logger.log(key + " " + val);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.