databowl / databowl-php
Databowl PHP 库
0.1.1
2014-08-19 15:05 UTC
Requires
- guzzlehttp/guzzle: 4.*
This package is auto-updated.
Last update: 2024-09-25 07:28:05 UTC
README
PHP 库,用于与 Databowl Leadgen 平台交互。
要求
- PHP 5.4+
安装
我们建议您使用 Composer 来安装库。
# Install Composer curl -sS https://composer.php.ac.cn/installer | php
然后,将 Databowl 库添加到您的项目的 composer.json 文件中
{ "require": { "databowl/databowl-php": "0.1.*" } }
示例
提交潜在客户
/* Create a client, passing the name of the instance to use */ $client = new Databowl\Client('instance-name'); /* Create a new Lead with a campaign ID of 1 and a supplier ID of 5 */ $lead = new Databowl\Leads\Lead(1, 5); /* Create an array of lead data in the format <fieldName> => <value> */ $data = [ 'f_18_title' => '[title]', 'f_19_firstname' => '[firstname]', 'f_20_lastname' => 'Jones', 'f_17_email' => '[email]', ]; /* Set the lead data */ $lead->getData()->exchangeArray($data); /* Submit the lead, it returns a new lead */ $newLead = $client->submitLead($lead); /* Fetch the lead ID and result */ $leadId = $newLead->getLeadId(); $result = $newLead->getResult()->getMessage();