findforsikring/leadvalidator-clients

There is no license information available for the latest version (1.0.2) of this package.

Wrapper for Leadvalidator API

1.0.2 2017-05-15 12:51 UTC

This package is auto-updated.

Last update: 2024-11-12 04:51:10 UTC


README

Installation

$ composer require findforsikring/leadvalidator-clients

Lead source usage

$client = new \LeadValidator\SourceClient("api token");

// List available campaigns
$campaigns = $client->getCampaigns();

// Detailed campaign info
$campaign = $client->getCampaign(12);

/* 
 * Post a lead
 * 1st parameter is campaign ID.
 * 2nd parameter must use keys defined in the campaign
 */
$success = $client->postLead(12, [
    'name' => 'Lead name',
    'phone' => '12345678',
    'email' => 'test@test.com'
]);

Lead customer usage

$client = new \LeadValidator\CustomerClient("api token");

/* 
 * Get all new leads (not delivered yet)
 * Optionally limit by campaign or source
 * Optional pagination
 */
$leads = $client->getNewLeads();

/* 
 * Get all leads from a period
 * Limit by creation-time or delivery-time
 * Optionally limit by campaign or source
 * Optional pagination
 */
$leads = $client->getLeadsFromPeriod();