# 用 ngrok 進行映照內網成外網
> ngrok http https://localhost:7269/
https://edd3-xxx-xxx-xxx-xxx.ngrok-free.app/ -> https://localhost:7269/
# ngrok 本機管理員
http://127.0.0.1:4040/
===> 在 line 註冊 Notify
Client ID: wpO642hWhtyWEixxxxxxxx
Client Secret: eX6DoCyvESUmFFKJvIPrS0oDAvvqXIRnBEyxxxxxxxx
§§ GET /oauth/authorize:form_post取到 code,state
GET https://notify-bot.line.me/oauth/authorize?response_type=code&scope=notify&response_mode=form_post&client_id=wpO642hWhtyWEixxxxxxxx&redirect_uri=https://d237-xxx-xxx-xxx-xxx.ngrok-free.app&state=12345678-1234-1234-1234-123456789012
===>
code: YoSirrQtggzWMgVL3qqwGs
state: 12345678-1234-1234-1234-123456789012
§§ 取 access_token with code, code 只能用一次的樣子
> curl -d "grant_type=authorization_code&redirect_uri=https://d237-xxx-xxx-xxx-xxx.ngrok-free.app&client_id=wpO642hWhtyWEixxxxxxxx&client_secret=eX6DoCyvESUmFFKJvIPrS0oDAvvqXIRnBEyxxxxxxxx&code=YoSirrQtggzWMgVL3qqwGs" https://notify-bot.line.me/oauth/token
{
"status" : 200,
"message" : "access_token is issued",
"access_token" : "eRjIZEBz4pWi3ZGTcM6A8aLs9JxTfPub3beWekqNL0W"
}
§§ 發送 LINE Notify 通知訊息
> curl -H "Authorization: Bearer eRjIZEBz4pWi3ZGTcM6A8aLs9JxTfPub3beWekqNL0W" -d "message=用郡組二的token送訊息" https://notify-api.line.me/api/notify
{"status":200,"message":"ok"}
§§ 取得目前 Access Token 狀態
> curl -H "Authorization: Bearer eRjIZEBz4pWi3ZGTcM6A8aLs9JxTfPub3beWekqNL0W" https://notify-api.line.me/api/status
{"status":200,"message":"ok","targetType":"GROUP","target":"測試Notify群組"}
§§ 撤銷目前 Access Token
> curl -X POST -H "Authorization: Bearer eRjIZEBz4pWi3ZGTcM6A8aLs9JxTfPub3beWekqNL0W" https://notify-api.line.me/api/revoke
{"status":200,"message":"ok"}