Featured image of post Send Line message api

Send Line message api

上次有用過telegram的傳送訊息API,這次來用看看LINE的要怎麼使用。

LINE API透過指令推送訊息到官方帳號。

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

Test: https://lin.ee/CFCJNsZ

Source: Messaging API reference | LINE Developers