smarkio/smarkio-api-client
Composer 安装命令:
composer require smarkio/smarkio-api-client
包简介
Accelerator to communicate with the Smark.io Internal API
README 文档
README
An accelerator to communicate with © Smark.io API to manage Lead Relations
Installation and usage with Composer
Add the following to your composer.json file in order to fetch the latest stable version of the project:
{
"require": {
"smarkio/smarkio-api-client": "*"
}
}
Then, in order to use the accelerator on your own PHP file, add the following:
require '[COMPOSER_VENDOR_PATH]/autoload.php';
Contents
- src/Smarkio/API - Code to interact with the Smarkio Internal API.
- examples/ - Some examples on how to use this accelerator.
Before you start
You need to obtain one API token to use the API. This token is bound to each user of the Smark.io system details.
Usage
Create a Lead Relation
$api_token = 'YOUR API TOKEN HERE'; $my_smarkio_url = 'YOUR SMARK.IO URL HERE'; //The ID of the first lead of the relation $originId = '359680'; //The ID of the second lead of the relation $destinyId = '359670'; //Slug of the relation type $type = 'family'; //Operation of the API, in this case to create a Lead Relation $operation = 'add'; // create Relation $relation = new Relation($originId, $destinyId, $type, $api_token); // send the request $response = $relation->send($operation,$my_smarkio_url);
Delete a Lead Relation
$api_token = 'YOUR API TOKEN HERE'; $my_smarkio_url = 'YOUR SMARK.IO URL HERE'; //The ID of the first lead of the relation $originId = '359680'; //The ID of the second lead of the relation $destinyId = '359670'; //Slug of the relation type $type = 'family'; //Operation of the API, in this case to delete a Lead Relation $operation = 'delete'; // create Relation $relation = new Relation($originId, $destinyId, $type, $api_token); // send the request $response = $relation->send($operation,$my_smarkio_url);
Get a Lead by ID
$api_token = 'YOUR API TOKEN HERE'; $my_smarkio_url = 'YOUR SMARK.IO URL HERE'; // The id of the lead $my_lead_id = 36; $lead_api = new \Smarkio\API\LeadAPI($api_token, $my_smarkio_url); $lead = $lead_api->getLead($my_lead_id);
Search Leads
$api_token = 'YOUR API TOKEN HERE'; $my_smarkio_url = 'YOUR SMARK.IO URL HERE'; $lead_api = new \Smarkio\API\LeadAPI($api_token, $my_smarkio_url); // Parameters to filter the Search // If null use defaults $parameters = array( 'id_min' => null, // eg: 123 'id_max' => null, // eg: 999 'creation_date_min' => null, // eg: '2015-07-01' 'creation_date_max' => null, // eg: '2015-07-31' 'integration_date_min' => null, // eg: '2015-07-01' 'integration_date_max' => null, // eg: '2015-07-31' 'limit' => null, // eg: 100 'offset' => null // eg: 0 ) // Get the paginated results $paginated_leads = $lead_api->searchLead($parameters); $continue_processing = true; // Get all the pages while ($continue_processing) { $leads = $paginated_leads->getLeads(); // Do something with the leads ... $continue_processing = $paginated_leads->hasNext(); if ( $continue_processing ) { // Get the next results $paginated_leads = $paginated_leads->next(); } }
smarkio/smarkio-api-client 适用场景与选型建议
smarkio/smarkio-api-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 1, 最近一次更新时间为 2015 年 01 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「lead」 「smarkio」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 smarkio/smarkio-api-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 smarkio/smarkio-api-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 smarkio/smarkio-api-client 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Integration with customer.io crm and tracking which customers are associated with which users.
Accelerator to communicate with the Smarkio Supplier API
A PSR-7 compatible library for making CRUD API endpoints
Integration package for Leadrock API
ERP CRM — leads, opportunities and campaigns for the Laravel ERP ecosystem
DaybydayCRM is a free, open-source and self-hosted CRM platform based of Laravel
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-01-06