LoginSignup
0
0

More than 3 years have passed since last update.

Google Apps ScriptでLINEユーザ情報を取得する

Posted at

LINEユーザ情報取得

LINEmessagingAPI
https://developers.line.biz/ja/reference/messaging-api/#get-profile

user.gs
const ACCESS_TOKEN = <LINEのアクセストークン>;
/*
* LINEユーザ情報取得
*/
function getUserInfo(userId) {
  // アクセス先
  var get_url = "https://api.line.me/v2/bot/profile/"+userId;
  // GETリクエスト
  var response = UrlFetchApp.fetch(get_url, {
    'headers': {
      'Content-Type': 'application/json; charset=UTF-8',
      'Authorization': 'Bearer ' + ACCESS_TOKEN,
    }
  });

  return response;
}

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0