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.

Post message through LINE Notify
Line-pushNotify.xml
(md5:321651905f8cacaec62afce1eb2f70a4)

    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.
    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.

    C1. access token(choose the destination when you get the token)Single-line inputRequired
    C2. Text Message(Within 1000 characters)Multi-line inputInserting EL expressions is also possibleRequired
    -variable namevariable label
    C1tokenaccess token(choose the destination when you get the token)
    C2MessageText Message(Within 1000 characters)
    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");
      }
    }