PodporaAPI dokumentace

Ukázka PERL volání mailkit.mailinglist.adduser

Ukázka volání v PERL

my $server_url = 'https://api.mailkit.eu/rpc.fcgi';
my $server = Frontier::Client->new('url' => $server_url, 'debug' => 0);

my $opt=Frontier::Client->boolean(0);    # Double opt-in (true/false)
my $cid=Frontier::Client->int(6960001);  # Your client ID as displayed in Profile/Integration
my $mid=Frontier::Client->int(117);      # Mailing list ID
my $target='_blank';

my $result = $server->call(
            'mailkit.mailinglist.adduser',
            $cid,
            'client_md5_hash_here',      # Your MD5 hash as displayed in Profile/Integration
            $mid,
            $opt,
            {
                'first_name', MIME::Base64::encode('First Name',
                'last_name', MIME::Base64::encode('Last Name',
                'email',MIME::Base64::encode('Email'),
                'status',MIME::Base64::encode('active'),              # Recipient status (active/unknown/temporary/permanent/unsub)
            },
            {
               'nick_name',MIME::Base64::encode('Nick Name'),
               'gender',MIME::Base64::encode('male'),                 # Gender of the recipient
               'phone',MIME::Base64::encode('Phone'),
               'mobile',MIME::Base64::encode('Mobile'),
               'fax',MIME::Base64::encode('FAX'),
               'street',MIME::Base64::encode('Street'),
               'city',MIME::Base64::encode('City'),
               'state',MIME::Base64::encode('State'),
               'country',MIME::Base64::encode('Country'),
               'zip',MIME::Base64::encode('ZIP/Postal Code'),
            },
            {
               'custom1',MIME::Base64::encode('custom1'),                    # Field for custom data
               'custom2',MIME::Base64::encode('custom2'),                    # Field for custom data
               'custom3',MIME::Base64::encode('custom3'),                    # Field for custom data
            }
            );