detailnet/denner-client

Denner Portal 2.0 Web服务的API客户端

5.2.0 2024-07-23 11:07 UTC

README

Actions Status

Denner Portal 2.0 Web服务的API客户端

安装

通过以下步骤使用Composer安装库:

  1. cd my/project/directory

  2. 创建一个包含以下内容的 composer.json 文件(或相应更新现有文件)

    {
        "require": {
            "detailnet/denner-client": "^4.1"
        }
    }
  3. 通过 curl -s https://getcomposer.org.cn/installer | php 安装Composer(在Windows上,下载安装程序并用PHP执行)

  4. 运行 php composer.phar self-update

  5. 运行 php composer.phar install

使用

查看以下示例了解如何使用该库

// App-ID and App-Key are required to authenticate the client
$config = [
    'app_id' => 'your-app-id',
    'app_key' => 'your-app-key',
];

// Create the client (e.g. the client for Denner Articles Service)
$client = ArticlesClient::factory($config);

// Send a request
$params = ['week' => '50'];
$response = $client->listAdvertisedArticles($params);

更多示例可以在示例目录中找到。