{
my($self, $json, $signature) = @_;
LINE::Bot::API::Event->validate_signature($json, $self->{channel_secret}, $signature);
}
sub parse_events_from_json {
my($self, $json) = @_;
LINE:
:Bot::API::Event->parse_events_json($json);
}
sub issue_link_token {
my($self, $user_id) = @_;
my $res = $self->request(post => "user/${user_id}/linkToken", +{});
LINE::Bot::API::Response
0, [], ['failed to validate signature']];
}
my $events = $bot->parse_events_from_json($req->content);
for my $event (@{ $events }) {
next unless $event->is_message
json` attribute is required" unless defined $args{json};
return bless { _json => $args{json} }, $class;
}
sub build {
my ($self) = @_;
return $self->{_build} //= decode_json($self->{_json
r::FlexMessage
=head1 SYNOPSIS
my $message = LINE::Bot::API::Builder::FlexMessage->new( json => $json_text );
$bot->push_message( $user_id, $message->build );
=head1 DESCRIPTION
This modu
.line.biz/console/fx/> to an object.
Structurally, a flex message is represented as an object in JSON with
smaller components. Here's an minimal example:
{
"type": "flex",
"altText":
"upToRemainingQuota": JSON::true,
}
Noted here that the value for "upToRemainingQuotae" must be one of the boolean values recognizied by L<JSON::XS>. See also L<JSON::XS/"other references">.
url::Headers;
use JSON::XS;
use LINE::Bot::API;
use LINE::Bot::API::Client;
our @CARP_NOT = qw( LINE::Bot::API::Client::Furl LINE::Bot::API::Client LINE::Bot::API);
my $JSON = JSON::XS->new->utf8;
ing API error: response body is empty.';
}
my ($ret, $error);
eval {
$ret = $JSON->decode($response_body);
1;
} or do {
$error = $@;
};
if ($error) {
ers = [];
} elsif (@_ == 4) {
($self, $url, $headers, $data) = @_;
}
my $json = $JSON->encode($data);
my($res_minor_version, $res_status, $res_msg, $res_headers, $res_content)
CARP_NOT = qw( LINE::Bot::API::Event LINE::Bot::API);
use Digest::SHA 'hmac_sha256';
use JSON::XS 'decode_json';
use MIME::Base64 'decode_base64';
use LINE::Bot::API::Event::Message;
use LINE::Bot::
API::Event::VideoViewingComplete',
);
sub parse_events_json {
my($self, $json) = @_;
my $events = [];
my $data = decode_json $json;
for my $event_data (@{ $data->{events} }) {
e_signature {
my($class, $json, $channel_secret, $signature) = @_;
return unless $signature && $json && $channel_secret;
my $json_signature = hmac_sha256($json, $channel_secret);
_secu