bartlomiejbeta/lead-desk-api-client-lib 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bartlomiejbeta/lead-desk-api-client-lib

Composer 安装命令:

composer require bartlomiejbeta/lead-desk-api-client-lib

包简介

LeadDesk Api Client

README 文档

README

This repository holds client library for lead-desk api. It uses HTTPlug to make the client more flexible.

More info about LD can be found on http://leaddesk.com/

More info about HTTPlug can be found on http://docs.php-http.org/en/latest/httplug/introduction.html

TODO

  • add cache support
  • add more lead desk api endpoints (feel free to PR)
  • add tests

Installing

Install package via composer

composer require bartlomiejbeta/lead-desk-api-client-lib

Require one of the following client implementations:

  • php-http/guzzle6-adapter
  • php-http/guzzle5-adapter
  • php-http/curl-client
  • php-http/socket-client
  • php-http/react-adapter
  • php-http/buzz-adapter
  • php-http/zend-adapter
  • php-http/cakephp-adapter

See all implementations: https://packagist.org/providers/php-http/client-implementation

For example: composer require php-http/curl-client

General Usage:

$clientCredentials = new ClientCredentials($token);
$httpsClient       = HttpClientDiscovery::find();
$msg               = MessageFactoryDiscovery::find();
$stream            = StreamFactoryDiscovery::find();

$apiClient = new ApiClient($httpsClient, $clientCredentials, $msg, $stream);

/** apiClient can be used to send any lead desk api request. $request must be instace of Psr RequestInterface*/
$apiClient->sendRequest($request);

LeadDeskApi Usage

/** but also you can use some already implemented lead desk endpoints by using this */
$leadDeskApi = new LeadDeskApiClient($apiClient);

/** contact exists -> refere to lead desk api documentation */
$contactFilter       = new ContactFilter($phone, $listId);
$existRepresentation = $leadDeskApi->contactExists($contactFilter);// @see ExistsRepresentation

/** find contact -> refere to lead desk api documentation */
$contactFilter      = new ContactFilter($phone, $listId);
$findRepresentation = $leadDeskApi->findContact($contactFilter);// @see FindRepresentation

/** get contact -> refere to lead desk api documentation */
$contactIdFilter   = new ContactIdFilter($contactId);
$getRepresentation = $leadDeskApi->getContact($contactIdFilter);// @see GetRepresentation

/** delete contact -> refere to lead desk api documentation */
$contactIdFilter     = new ContactIdFilter($contactId);
$existRepresentation = $leadDeskApi->deleteContact($contactFilter);// @see ExistsRepresentation

/** create contact -> refere to lead desk api documentation */
$contactRepresentation = (new ContactRepresentation())
				->setPhone($phone)
				...;
							
$createRepresentation   = $leadDeskApi->createContact($contactRepresentation);// @see CreateRepresentation

统计信息

  • 总下载量: 18
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2017-08-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固