findforsikring / leadvalidator-clients
Wrapper for Leadvalidator API
Installs: 4 036
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 5
Forks: 0
Open Issues: 0
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();