NAME
WebService::Jandi::WebHook - Perl interface to Jandi Service Incoming Webhook
SYNOPSIS
my $jandi = WebService::Jandi::WebHook->new('https://wh.jandi.com/connect-api/webhook/md5sum');
my $msg = {
body => '[[PizzaHouse]](http://url_to_text) You have a new Pizza order.',
connectColor => '#FAC11B',
connectInfo => [
{
title => 'Topping',
description => 'Pepperoni',
},
{
title => 'Location',
description => 'Empire State Building, 5th Ave, New York',
imageUrl => 'http://url_to_text'
}
]
};
my $res = $jandi->request($msg); # HTTP::Tiny response
or
my $res = $jandi->request('Hello, world');
die "Failed!\n" unless $res->{success};
METHODS
new($webhook_url)
request($message)
my $res = $self->request($message);
$message
is a simple string or hashref.
$res
is HTTP::Tiny $response
.
Hashref format.
{
body => '[[PizzaHouse]](http://url_to_text) You have a new Pizza order.',
connectColor => '#FAC11B',
connectInfo => [
{
title => 'Topping',
description => 'Pepperoni',
},
{
title => 'Location',
description => 'Empire State Building, 5th Ave, New York',
imageUrl => 'http://url_to_text'
}
]
}
body
and simple string support markdown link format.
[text](url)
COPYRIGHT and LICENSE
The MIT License (MIT)
Copyright (c) 2017 Hyungsuk Hong