Bipin Sasi Techie, Author of the book Leadership Puzzles You can follow me on X formerly called twitter @BipinSasi No comments

Use UrlFetchApp() as a Backup for Google Services

The UrlFetchApp() allows you to connect to external APIs, but it can also be used
to connect to Google services. Sometimes the Google Apps Services do not
provide access to the full API and there is no Advanced service - such as Google
Sites. UrlFetchApp() works faster and is more reliable than the Google Apps builtin
service SitesApp, for example:

var url = “https://sites.google.com/feeds/content/” + _DOMAIN_ + “/” + _SITE_
NAME_ + “?alt=json&access_token=” + _TOKEN_;
var requestData = {
“method”: “GET”,
“Host”: “sites.google.com”,
“headers”: {“GData-Version”: “1.4”},
“oAuthUseToken”: “always”
};
var result = UrlFetchApp.fetch(url, requestData);
var content = result.getContentText();
//Logger.log(“Content Text: “ + content);
var jsonContent = Utilities.jsonParse(content);



With Apps Script, you can easily capture settings for Apps Script gadgets by
passing parameters. This method can be used for XML gadgets for Google Sites
or as a content service.
As an example, make a call to the Apps Script file with some parameters that are
crunched and ultimately returned as finished data that any application can then
call. To pass the parameters, you’ll need to use the doGet function and then edit
the App Script URL.

function doGet(e)
{
var yourParameter = e.parameter.param;
}


Next, the resulting service URL you will receive from Apps Script when publishing
needs to be edited to allow parameters to be passed through the URL, as follows:
You will get this format back:
https://script.google.com/a/macros/mydomain.com/s/A1Z5Ri7QL9fi7yJ5cU3/exec
You will need to change the URL to this format:
https://sites.google.com/a/macros/mydomain.com/
exec?service=A1Z5Ri7QL9fi7yJ5cU3&param=4

GENERAL CLIENT-SIDE STORAGE SECURITY

Sal Bipin Sasi
6 min read

What Resume Screeners Look For

Sal Bipin Sasi
6 min read

Comments (0)

Post a Comment

Cancel