There are two ways to import the library to your project:
- Set in your script project dashboard
- Add the configuration into your
appsscript.json
- Script Id:
1VwgEzQRhb6igER9A5Jd_yXHaTBUG1tEBXxt6_W5UudkyUAeFT9T0vY_N
- Add the latest version: for example,
4
- Use the identifier
FetchJson
These actions will update your appsscript.json
.
Or, you can update it directly adding to the dependencies
object:
"dependencies": {
"libraries": [
{
"userSymbol": "FetchJson",
"version": "4",
"libraryId": "1VwgEzQRhb6igER9A5Jd_yXHaTBUG1tEBXxt6_W5UudkyUAeFT9T0vY_N"
}
]
}
The script runs in the timezone
Etc/GMT
.
Required: headers
Optional: verbose
, where the default value is false
Example:
const options = {
headers: {},
verbose: true,
};
const response = FetchJson.Get(url, options);
The payload
is a JSON object.
const response = FetchJson.Post(url, payload, options);
const response = FetchJson.Put(url, payload, options);
const response = FetchJson.Remove(url, options);
Use the option
parameter verbose
set to true
to enable logging.
This library has been tested along with the library Asaas Payment API.