NAME

WebService::SendInBlue - Perl API for https://www.sendinblue.com/ REST API

SYNOPSIS use WebService::SendInBlue;

my $api = WebService::SendInBlue->new('api_key'=>'API_KEY') 

my $campaigns_list = $a->campaigns();

unless ( $campaigns_list->is_success ) {
  die "Error getting campaigns: 
}

for my $campaign ( @{ $campaigns_list->data()->{'campaign_records'} ) {
  ... do something for each campaign
}

DESCRIPTION

This module provides a simple API to the SendInBlue API.

The API reference can be found here: https://apidocs.sendinblue.com/

You will need to register and set up your account with SendInBlue, you'll need an API key to use this module.

CONSTRUCTOR

new ( api_key => 'your_api_key' )

This is the constructor for a new WebService::SendInBlue object. The app_key is required.

METHODS

Campaign API

Lists

lists ( %params )

Retrieves lists information.

Supported parameters: https://apidocs.sendinblue.com/list/#1

lists_users ( lists_ids => [...], %params )

Retrieves details of all users for the given lists. lists_ids is mandatory.

Supported parameters: https://apidocs.sendinblue.com/list/#1

Campaigns

campaigns ( %params )

Retrieves details of all campaigns.

Supported parameters: https://apidocs.sendinblue.com/campaign/#1

campaign_details ( $campaign_id, %params )

Retrieve details of any particular campaign. $campaign_id is mandatory.

Supported parameters: https://apidocs.sendinblue.com/campaign/#1

campaign_recipients ( $campaign_id, $notify_url, $type )

Export the recipients of a specified campaign. It returns the background process ID which on completion calls the notify URL that you have set in the input. $campaign_id, $notify_url and $type are mandatory.

Supported parameters: https://apidocs.sendinblue.com/campaign/#6

campaign_recipients_file_url ( $campaign_id, $type )

Exports the recipients of a specified campaign and returns the remote url of the export result file. This method calls the campaign_recipients, waits for the export job completion, and retrieves the url of the export file. The file url is returned in the response data 'url' attribute

Example:

my $result = $api->campaign_recipients_file_url($campaign_id, 'all');
my $file_url = $result->data->{'url'};

Supported parameters: https://apidocs.sendinblue.com/campaign/#6

SMTP API

Aggregate reports

smtp_statistics( %params )

Retrieves reports for the SendinBlue SMTP account

Supported parameters: https://apidocs.sendinblue.com/statistics/

SEE ALSO

For information about the SendInBlue API: https://apidocs.sendinblue.com

To sign up for an account: https://www.sendinblue.com/

LICENCE AND COPYRIGHT

Copyright (C) 2016 Bruno Tavares. All Rights Reserved.

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

AUTHOR

Bruno Tavares <eu@brunotavares.net>