LoginSignup
2
0

More than 5 years have passed since last update.

LINE Rich Menu API のWindowsでの画像のアップロードの仕方

Last updated at Posted at 2017-11-11

LINE MessageAPIでRich Menu APIを利用するのに画像をアップロードするときにWindowsだとcUrlが無いのでどうしたらいいんだっていう時のメモ

Rich Menu APIに関してはこちらを参照
LINE BotのRich Menu APIの使い方まとめ

1: PowerShellをコマンドラインで立ち上げる
c:xxx > powershell

2: headerやファイルのパスを変数として登録しておく

$headers = @{"Authorization" = "Bearer {CHANNEL_ACCESS_TOKEN}";"Content-Type"="image/jpeg"}
$imagePath = "C:\xxxx\xxxxx.jpg"

3: 下記のコマンドを実行

Invoke-RestMethod -Uri "https://api.line.me/v2/bot/richmenu/{richMenuId}/content" -Method POST -Headers $headers  -InFile $imagePath2
2
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
2
0