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

  • Line-pushNotify.xml
    • Since Rhino (deprecated) is specified as the script engine, a setting error will occur even if you install this in a workflow App
    • To use this Add-on, you need to change the script engine and modify the script accordingly
    • A modified version is in preparation

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.

1 thought on “Post Message through LINE Notify”

  1. Pingback: Sending a Message to LINE in the Middle of a Workflow – Questetra Support

Comments are closed.

%d bloggers like this: