crayon/arta-php-sdk

Arta 公共 API 提供报价生成、运输预订和跟踪功能。此外,API 还允许 Arta 合作伙伴组织为他们的账户配置电子邮件和 webhook 通知。

0.2 2024-01-03 18:08 UTC

This package is auto-updated.

Last update: 2024-09-03 19:27:56 UTC


README

Arta 公共 API 提供报价生成、运输预订和跟踪功能。此外,API 还允许 Arta 合作伙伴组织为他们的账户配置电子邮件和 webhook 通知。

更多信息,请访问 https://manual.arta.io/.

安装 & 使用

需求

PHP 7.4 及更高版本。也应与 PHP 8.0 兼容。

Composer

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

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

然后运行 composer install

手动安装

下载文件并包含 autoload.php

<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');

入门

请遵循 安装程序,然后运行以下操作

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



// Configure API key authorization: apiKeyAuth
$config = Arta\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Arta\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new Arta\Client\Api\ApiKeysApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$authorization = ARTA_APIKey s0e1t2e3c4a5s6t7r8o9n10o11m12y; // string | Authorize your API calls with an Arta API token
$api_keys_create_request = new \Arta\Client\Model\ApiKeysCreateRequest(); // \Arta\Client\Model\ApiKeysCreateRequest

try {
    $result = $apiInstance->apiKeysCreate($authorization, $api_keys_create_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ApiKeysApi->apiKeysCreate: ', $e->getMessage(), PHP_EOL;
}

API 端点

所有 URI 都是相对于 https://api.arta.io

模型

授权

API定义的认证方案

apiKeyAuth

  • 类型: API密钥
  • API密钥参数名称: 授权
  • 位置: HTTP头

测试

要运行测试,请使用

composer install
vendor/bin/phpunit

作者

hello@arta.io

关于此包

此PHP包是由OpenAPI Generator项目自动生成的

  • API版本: 2021-01-01
  • 构建包: org.openapitools.codegen.languages.PhpClientCodegen