NAME

LINE::Notify::Simple

VERSION

1.02

SYNOPSIS

#!/usr/bin/env perl

use strict;
use warnings;
use utf8;
use feature qw(say);
use LINE::Notify::Simple;

my $access_token = 'your line access token';
my $message = "\nThis is test message.";
my $line = LINE::Notify->new({access_token => $access_token});

my $res = $line->notify($message);
if ($res->is_success) {
    say $res->message;
} else {
    say $res->status_line . ". ". $res->message;
}

exit;

DESCRIPTION

LINE Notify API simple & easy POST request module.

METHOD

notify

POST https://notify-api.line.me/api/notify. Return LINE::Notify::Simple::Response.

my $message = "\nThis is test message.";
my $res = $line->notify($message);
if ($res->is_success) {
    say $res->message;
} else {
    say $res->status_line . ". ". $res->message;
}
  • message(required)

notify_detail

Hashref keys are message, imageThumbnail, imageFullsize, imageFile, stickerPackageId, stickerId and notificationDisabled

# see https://developers.line.biz/ja/docs/messaging-api/sticker-list/
my $data = {
    message          => "\nThis is test message.",
    stickerPackageId => 11539,
    stickerId        => 52114110
};
my $res = $line->notify_detail($data);
if ($res->is_success) {
    say $res->message;
} else {
    say $res->status_line . ". ". $res->message;
}

Using imageFile

my $data = {
    message   => "\nThis is test message.",
    imageFile => "/path/to/image.png"
};
my $res = $line->notify_detail($data);
  • message(required)

  • stickerPackageId(optional)

  • stickerId(optional)

  • notificationDisabled(optional).

  • imageThumbnail(optional)

  • imageFullsize(optional)

  • imageFile(optional). file type is must be png or jpg

AUTHOR

Akira Horimoto <emperor.kurt _at_ gmail.com>

SEE ALSO

https://notify-bot.line.me/doc/ja/

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.