waynestate/waynestate-api

Wayne State University v1 API的API包装器

1.2.4 2022-10-19 14:44 UTC

This package is auto-updated.

Last update: 2024-09-19 18:59:02 UTC


README

Wayne State University API的PHP包装器 http://api.wayne.edu/

安装

要安装此库,请运行以下命令,您将获得最新版本

composer require waynestate/waynestate-api

使用方法

创建对象

# start.php

use Waynestate\Api\Connector;

...

$api = new Connector(API_KEY);

// Set the params
$params = array(
    'promo_group_id' => 123,
    'is_active' => '1',
    'ttl' => TTL,
);

// Get promotions from the API
$promos = $api->sendRequest('cms/promotions/listing', $params);

在实例化Connector之前设置唯一的端点 之前

define('API_ENDPOINT', 'http://api.domain.com/v1/');

在实例化Connector之后设置唯一的端点 之后

$api->cmsREST = 'http://api.domain.com/v1/';

临时使用'生产'端点

# Use the production endpoint for only the next $api->sendRequest() call
$api->nextRequestProduction();

最好与以下包一起使用

贡献

  1. 复制仓库
  2. 创建您的功能分支 (git checkout -b my-new-feature)
  3. 进行更改
  4. 提交更改 (git commit -am '添加了一些功能')
  5. 推送到分支 (git push origin my-new-feature)
  6. 创建新的Pull Request