Post Message through LINE Notify
Post message to your LINE Group through LINE Notify. In advance you have to get a personal access token. When get the one, choose where messages are sent.
2017 © Questetra, Inc. (MIT License)
Configs
  • C1. access token(choose the destination when you get the token) *
  • C2. Text Message(Within 1000 characters) *
Script
main();
function main(){
  var token = configs.get("token");
  var messageText = configs.get("Message");
  //check length of message
  messageCheck(messageText);
  //send message to LINE Notify API
  var response = httpClient.begin()
    .bearer(token)
    .multipart("message", messageText)
    .post('https://notify-api.line.me/api/notify');
  var responseText = response.getResponseAsString();
  engine.log(responseText)
  //check whether sending succeeded
  if (response.getStatusCode() != 200) {
    throw "Status Code is not 200." + response.getStatusCode();
  }
}
function messageCheck(messageText){
  if(messageText == null){
    throw "Message is empty."
  }else if(messageText.length() > 1000){
    throw("Message Length over 1000");
  }
}

Download

Capture

Notes

  • C1.access token(choose the destination when you get the token)
  • C2.Text Message(Within 1000 characters)

See also

How to Use.

1. Log in to LINE Notify (https://notify-bot.line.me/) with your LINE account.

2. Issue a personal access token at “Generate access token (For developers)” at the bottom of “My Page”.

3. Enter the issued access token into “C1. Access token” on the Config screen.

P.S.
It is a specification that you select from your participating group when you acquired an access token as the destination group.
In addition, you can set the message to be sent one-on-one only to you.

%d bloggers like this: