kenken999's picture
test
275b9f3
raw
history blame
550 Bytes
class LineApi {
/**
* Send a request to LINE API
* @param {string} endpoint
* @param {object} payload
* @return {object} response
*/
function sendRequest(endpoint, payload) {
var options = {
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
"payload": JSON.stringify(payload)
};
var response = UrlFetchApp.fetch("https://api.line.me/v2/" + endpoint, options);
return JSON.parse(response.getContentText());
}
}