Title1

Title2

Title3

4-4 取得群組資料

 


/*============================================
  用 「groupId」得到 Line Group Data
============================================*/
function getLineGroup(groupId){  
  let response,lineGroup;
  try {       
    response = UrlFetchApp.fetch("https://api.line.me/v2/bot/group/"+groupId+"/summary", {
      "method": "GET",
      "headers": {
        "Authorization": 'Bearer ' + CHANNEL_ACCESS_TOKEN,
        "Content-Type": "application/json"
      },
    });
    lineGroup = JSON.parse(response); // 解析 json
  }catch(e){    
    lineGroup = {
      groupId: '',
      groupName: '',
      pictureUrl: '',
    };
    console.log(e);
  }

  //console.log(lineGroup);
  return lineGroup;
}