commercesignals/csapi-php
Composer 安装命令:
composer require commercesignals/csapi-php
包简介
API client library to work with the Commerce Signals platform.
README 文档
README
Library to interface with the Commerce Signals platform.
Installing with Composer
composer require commercesignals/csapi-php
Usage
Authorize your client
const CERT_FILE_NAME = 'my-api-key-private-cert.pem'; const API_KEY = '0b70012a-5a7a-2b90-815a-aa73a7f8001a'; // My API Key const API_BASE = 'https://api.commercesignals.com/'; $api = new CommerceSignals\API(API_BASE, [ 'apiKey' => API_KEY, 'cert' => file_get_contents(__DIR__ . '/' . CERT_FILE_NAME) ]);
The API class
The main API class is used to build the API request to issue.
The methods of the API call can be chained to create the segments of the request you are making.
Each chained method has an optional $id paramater that can be passed to request a specific resource from the segment part.
The final method in the call determins the type of HTTP request being made and has an optional $payload paramater that will be used as the request BODY.
get() => GET request
update() => PATCH request
save() => POST or PUT (depending on if the payload BODY has an id set or not)
Example
$api->signals('0a000337-574f-223e-8156-4f3a98e707a1') ->requests('0a00017c-5aac-1195-82ba-ae6ea3fa000a') ->results() ->get();
HTTP Request
GET https://api.commercesignals.com/rest/v1/signals/0a00...07a1/requests/0a00...a000a/results
Calling Endpoint Examples
统计信息
- 总下载量: 16
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2017-03-17