Demo¶
Test list and read actions.
The redirect must be turned on in the ajax request.
You can use the following URL for the GET request.
GET
https://script.google.com/macros/s/AKfycbyLIRDURImSw5kIXWx_4Lg2X6L4QC1TThNLuAimjiEUIalHOXrfnX5arGniQ4j_6IP2/exec?action=list
To use the POST process, send the following data to this URL.
POST
https://script.google.com/macros/s/AKfycbyLIRDURImSw5kIXWx_4Lg2X6L4QC1TThNLuAimjiEUIalHOXrfnX5arGniQ4j_6IP2/exec?action=read
Data
{
"id": "1014327493180"
}
Try With JavaScript¶
Try List Action¶
fetch("https://script.google.com/macros/s/AKfycbyLIRDURImSw5kIXWx_4Lg2X6L4QC1TThNLuAimjiEUIalHOXrfnX5arGniQ4j_6IP2/exec?action=list")
.then(res => res.json())
.then(res => console.log(res));
fetch("https://script.google.com/macros/s/AKfycbyLIRDURImSw5kIXWx_4Lg2X6L4QC1TThNLuAimjiEUIalHOXrfnX5arGniQ4j_6IP2/exec?action=list", {
method: "POST",
headers: {
"content-type": "application/json"
},
body: JSON.stringify({
limit: 5
})
})
.then(res => res.json())
.then(res => console.log(res));
Try Read Action¶
fetch("https://script.google.com/macros/s/AKfycbyLIRDURImSw5kIXWx_4Lg2X6L4QC1TThNLuAimjiEUIalHOXrfnX5arGniQ4j_6IP2/exec?action=read&id=1014327493180")
.then(res => res.json())
.then(res => console.log(res));
fetch("https://script.google.com/macros/s/AKfycbyLIRDURImSw5kIXWx_4Lg2X6L4QC1TThNLuAimjiEUIalHOXrfnX5arGniQ4j_6IP2/exec?action=read", {
method: "POST",
headers: {
"content-type": "application/json"
},
body: JSON.stringify({
id: "1014327493180"
})
})
.then(res => res.json())
.then(res => console.log(res));
fetch("https://script.google.com/macros/s/AKfycbyLIRDURImSw5kIXWx_4Lg2X6L4QC1TThNLuAimjiEUIalHOXrfnX5arGniQ4j_6IP2/exec?action=read&id=1014327493180&asJSON=true")
.then(res => res.json())
.then(res => console.log(res));