1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Qiitaのアクセス数取得自動化 LINE編③

1
Posted at

データ連携に奮闘中の皆様、いかがお過ごしでしょうか。

前回は、「LINE Messaging API」を設定し、「チャネルアクセストークン」を取得しました。

LINEのドキュメントを確認し、メッセージ送信のサンプルコードを取得したいと思います。

下記がサンプルコードです。

curl -v -X POST https://api.line.me/v2/bot/message/push \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {channel access token}' \
-d '{
    "to": "U4af4980629...",
    "messages":[
        {
            "type":"text",
            "text":"Hello, world1"
        },
        {
            "type":"text",
            "text":"Hello, world2"
        }
    ]
}'

取得済みの「チャネルアクセストークン」を入れて、宛先をテスト用にすれば、テストできそうですね:star:

次回は宛先(Toに書くもの)を取得したいと思います!

1
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?