定制 fasttrack/fasttrack-client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

fasttrack/fasttrack-client

Composer 安装命令:

composer require fasttrack/fasttrack-client

包简介

This Fasttrack library enables you to request the Fasttrack API in a convenient way. For more information about the Fasttrack API please see https://api.fasttrack-intl.com

README 文档

README

Installation

Add to your composer.json:

{
    "require": {
        "fasttrack/fasttrack-client": "*"
    }
}

And do:

composer install

Usage

Get company

<?php
require 'vendor/autoload.php';

use Fasttrack\Fasttrack;

$client = new \Fasttrack\Fasttrack('your_token');

try {
  $company = $client->getCompany('example.com');
  print_r($company);
} catch (Exception $err) {
  print_r($err);
}

?>

Get contact

<?php
require 'vendor/autoload.php';

use Fasttrack\Fasttrack;

$client = new \Fasttrack\Fasttrack('your_token');

try {
  $company = $client->getContact('example@example.com');
  print_r($company);
} catch (Exception $err) {
  print_r($err);
}

?>

Error handling

<?php
require 'vendor/autoload.php';

use Fasttrack\Fasttrack;
use Fasttrack\Exceptions;

$client = new \Fasttrack\Fasttrack('your_token');

try {
  $company = $client->getContact('example@example.com');
  print_r($company);
} catch (\Fasttrack\Exceptions\UnauthorizedException $e) {
  print_r('UnauthorizedException');
}

?>

Available exceptions

  • BadParametersException: send parameters through GET method
  • BadRequestException: request is malformed
  • InternalServerException
  • InvalidVersionException: API version is invalid
  • MethodNotAllowedException: you tried to access an endpoint with an invalid method
  • NoResultException: no result matching your request
  • NotAcceptableException: you requested a format that is not json
  • NotFoundException: specified endpoint could not be found
  • TooManyRequestsException: you made too many requests on the API in a short period of time
  • UnauthorizedException: API key is wrong
  • VersionRequiredException: send API version in the HTTP Accept headers

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-07-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固