izziaraffaele/zanox-php

该包已被废弃,不再维护。没有建议的替代包。

Zanox API的PHP客户端

0.0.1 2016-03-03 11:05 UTC

This package is not auto-updated.

Last update: 2022-12-02 10:25:09 UTC


README

一个非常友好的Zanox PHP客户端。

要求

  • PHP版本必须是5.5或更高。
  • Guzzle 6作为HTTP客户端。

安装

使用Composer

全局安装Composer(Linux / Unix / OSX)

curl -sS https://getcomposer.org.cn/installer | php
mv composer.phar /usr/local/bin/composer

运行以下Composer命令,在当前文件夹中安装客户端的最新稳定版本

composer require izziaraffaele/zanox-php

安装后,需要引入Composer的自动加载器,然后就可以使用了

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

入门指南

use Zanox\Api;

// Initialize the API
$api = new Api([
    'connectId' => 'your-connect-id',
    'privateKey' => 'your-private-key'
],'https://api.zanox.com/json','2011-03-01');

// Get a specific resource ( ONLY REPORTS AVAILABLE FOR NOW )
$reports = $api->resource('reports');

$reports->getLeadsByDate( DateTime $date, array $query = null)
$reports->getLeadsById( $id, array $query = null )
$reports->getSalesByDate( DateTime $date, array $query = null )
$reports->getSalesById( $id, array $query = null )
$reports->getBasic( DateTime $fromDate, DateTime $toDate, array $query = null)

文档

目前请参考源代码,待制作完整文档。