zephia/sirena-api-client

1.0.7 2019-03-13 21:28 UTC

This package is not auto-updated.

Last update: 2024-09-15 04:36:56 UTC


README

Sirena API 用于潜在客户提供商和潜在客户数据操作

此 PHP 包由 Swagger Codegen 项目自动生成(Swagger Codegen)

  • API 版本:1.5.0
  • 构建包:io.swagger.codegen.languages.PhpClientCodegen 了解更多信息,请访问 http://www.getsirena.com

要求

PHP 5.4.0 及以上

安装与使用

Composer

要通过 Composer 安装绑定,请将以下内容添加到 composer.json

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/zephia/sirena-api-client.git"
    }
  ],
  "require": {
    "zephia/sirena-api-client": "1.*"
  }
}

然后运行 composer install

手动安装

下载文件并包含 autoload.php

    require_once('/path/to/SwaggerClient-php/autoload.php');

测试

要运行单元测试

composer install
./vendor/bin/phpunit

入门指南

请遵循 安装过程,然后运行以下命令

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: ApiKey
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
// Configure OAuth2 access token for authorization: OAuth2
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$api_instance = new Swagger\Client\Api\InteractionsApi();
$format = "format_example"; // string | An optional flag to force a response format. Note that the API also supports content negotiation and honors the Accept header.
$agent = "agent_example"; // string | The id of the agent to filter
$status = "status_example"; // string | The status to filter
$created_after = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | The start date to filter interactions by their creation date
$start = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | @deprecated - use createdAfter The start date to filter interactions by their creation date (alias of createdAfter)
$created_before = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | The end date to filter interactions by their creation date
$end = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | @deprecated - use createdBefore The end date to filter interactions by their creation date (alias of createdBefore)

try {
    $result = $api_instance->getInteractions($format, $agent, $status, $created_after, $start, $created_before, $end);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InteractionsApi->getInteractions: ', $e->getMessage(), PHP_EOL;
}

?>

API 端点文档

所有 URI 都相对于 http://api.getsirena.com/v1

模型文档

授权文档

API 密钥

  • 类型:API 密钥
  • API 密钥参数名:api-key
  • 位置:URL 查询字符串

OAuth2

  • 类型:OAuth
  • 流程:accessCode
  • 授权 URLhttp://localhost:2000/oauth2/authorization
  • 作用域:
  • leads:write:潜在客户提供商
  • prospects:read:读取潜在客户
  • prospects:readAdditionalData:读取潜在客户附加数据
  • prospects:write:写入潜在客户
  • notifications:通知

作者

it@getsirena.com