smartlook/webapi

该软件包最新版本(v1.0.1)没有可用的许可信息。

Smartlook Web API PHP客户端。

v1.0.1 2016-10-17 13:53 UTC

This package is not auto-updated.

Last update: 2024-09-14 19:58:43 UTC


README

Build Status

Smartlook Web API PHP客户端。

安装

最佳安装方法是使用 Composer

$ composer require smartlook/webapi

用法

$api = new \Smartlook\Webapi\Client();
$api->authenticate(YOUR_API_KEY);
$response = $api->call(API_METHOD, API_PARAMS); // returns array
  • API_METHOD 是方法名称,请参阅 方法概述
  • API_PARAMS 是参数数组
  • $response 总是数组
  • 每个响应都有 ok 属性

Nette 一起使用

在 config.neon 中注册扩展

extensions:
	smartlook: Smartlook\Webapi\WebapiExtension

将API密钥添加到配置文件中

smartlook:
	apiKey: YOUR_API_KEY

然后您可以通过DI将API连接作为服务使用。

示例