Skip to content

Instantly share code, notes, and snippets.

@Porrapat
Created January 27, 2020 07:22
Show Gist options
  • Select an option

  • Save Porrapat/680d21bb5e3a12760e968452c1b218a8 to your computer and use it in GitHub Desktop.

Select an option

Save Porrapat/680d21bb5e3a12760e968452c1b218a8 to your computer and use it in GitHub Desktop.

Revisions

  1. Porrapat created this gist Jan 27, 2020.
    16 changes: 16 additions & 0 deletions send-line-notify-message.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    # To use : add your line notify api token
    LINE_NOTIFY_ACCESS_TOKEN=

    # Provide your multiline text. We use shell script heredoc syntax here.
    MESSAGE=$(cat << END_HEREDOC
    HELLO LINE 1
    HELLO LINE 2
    END_HEREDOC
    )

    # Basic Implementation
    curl -X POST -H "Authorization: Bearer $LINE_NOTIFY_ACCESS_TOKEN" -d "&message=$MESSAGE" "https://notify-api.line.me/api/notify"

    # # Send Sticker Too
    # curl -X POST -H "Authorization: Bearer $LINE_NOTIFY_ACCESS_TOKEN" -d "&message=$MESSAGE" -d "stickerPackageId=1" -d "stickerId=407" "https://notify-api.line.me/api/notify"