LiveChat APIで Delete a tag を試したときの備忘録
コード.gs
function deleteTag() {
var tag = '追加タグ名';
var payload = {
"group": 0
}
var options = {
"method": "delete",
"headers": {
"X-API-Version": 2,
"Content-Type": "application/json",
"Authorization": "Bearer " + getProp("token")
},
"payload": JSON.stringify(payload)
};
var url = "https://api.livechatinc.com/tags/" + tag;
var response = UrlFetchApp.fetch(url, options);
Logger.log(response)
}
function getProp(key) {
return PropertiesService.getScriptProperties().getProperty(key);
}
|
getProp('token')はアクセストークンです
LiveChatのアクセストークンを取得したい
参考
Delete a tag
https://developers.livechatinc.com/docs/rest-api/#delete-a-tag