colling-media/sharpspring-api

此包最新版本(v0.0.1)没有提供许可证信息。

v0.0.1 2016-11-09 16:40 UTC

This package is auto-updated.

Last update: 2024-09-13 04:59:48 UTC


README

超简单的 SharpSpring API v1 包装器,使用 PHP 编写。

让我们通过营销自动化和入站营销来提升您的网站。

Angelo Públio

声明您的 accountID 和 secretKEY

if ( !defined('SHARPSPRING_ACCOUNTID') )
	define('SHARPSPRING_ACCOUNTID', 'YOUR-ACCOUNT-ID');
		
if ( !defined('SHARPSPRING_SECRETKEY') )
	define('SHARPSPRING_SECRETKEY', 'YOUR-SECRET-KEY');

包含库

示例:在 WordPress 主题文件夹内使用 '/lib/sharpspring-api/src/' 文件夹

if (!class_exists('AngeloPublio\SharpSpring'))
	require_once(get_template_directory().'/lib/sharpspring-api/src/SharpSpring.php');

调用 API

调用 getLeads 示例

$SharpSpring = new \AngeloPublio\SharpSpring(SHARPSPRING_ACCOUNTID, SHARPSPRING_SECRETKEY);

$limit = 500;                                                                         
$offset = 0;    
   
$result = $SharpSpring->call('getLeads', 
				array('where' => array('emailAddress' => 'email-to-filter@test.com'), 'limit' => $limit, 'offset' => $offset)
			);
print_r($result);

调用 getFields 示例

$SharpSpring = new \AngeloPublio\SharpSpring(SHARPSPRING_ACCOUNTID, SHARPSPRING_SECRETKEY);

$limit = 500;                                                                         
$offset = 0;    
   
$result = $SharpSpring->call('getFields', 
				array('where' => array(), 'limit' => $limit, 'offset' => $offset)
			);
print_r($result);