abbadon1334/scloby-client-api

dev-master 2021-02-28 16:59 UTC

This package is auto-updated.

Last update: 2024-09-15 19:08:00 UTC


README

https://developer.scloby.com/apidoc/assets/documentation.json 简介 认证令牌通过 Oauth2 标准发放 ( https://oauth.ac.cn) 您可以在我们的开发者门户申请 Scloby 测试账户 https://developer.scloby.com 这里是您的测试用的 ClientIdClientSecretclient_id: SclobyApiDocs client_secret: DdyPNPvfPOGa0Izjct0C 所有数据都是 JSON 格式,POST/PUT 请求的 Content-Type 标头必须设置为 application/json。 搜索参数 您可以使用某些参数组合集合中的所有第一级属性进行搜索,或者指定一个值:property = VALUE 如果您正在搜索具有特定属性值的所有项目 property_since = MIN_VALUE 如果您正在搜索属性值大于(或等于)MIN_VALUE 的所有项目 property_max = MAX_VALUE 如果您正在搜索属性值小于(或等于)MAX_VALUE 的所有项目 property_like = LIKE_VALUE 如果您正在搜索包含子串内容。您可以使用 property_since 和 property_max 来模拟 between 操作符 如果您使用 equal 操作符,则忽略该参数的其他操作符 如果您在字符串中使用 _max 或 _since 操作符,则使用字母顺序

此 PHP 包是由 Swagger Codegen 项目自动生成的

要求

PHP 5.5 及以上版本

安装与使用

Composer

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

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

然后运行 composer install

手动安装

下载文件并包含 autoload.php

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

测试

要运行单元测试

composer install
./vendor/bin/phpunit

入门

请按照 安装流程 进行操作,然后运行以下命令

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

// Configure OAuth2 access token for authorization: oAuth2AuthCode
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Swagger\Client\Api\AccountingDepartmentsApi(
    // 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
);
$pagination = true; // bool | Pagination parameter
$per_page = 56; // int | Results_per_page
$page = 56; // int | PAGE_NUMBER(starting from 0 to TOTAL_PAGE-1)

try {
    $result = $apiInstance->departmentsGet($pagination, $per_page, $page);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountingDepartmentsApi->departmentsGet: ', $e->getMessage(), PHP_EOL;
}

// Configure OAuth2 access token for authorization: oAuth2AuthCode
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Swagger\Client\Api\AccountingDepartmentsApi(
    // 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
);
$id = "id_example"; // string | id of the Department that need to be deleted

try {
    $apiInstance->departmentsIdDelete($id);
} catch (Exception $e) {
    echo 'Exception when calling AccountingDepartmentsApi->departmentsIdDelete: ', $e->getMessage(), PHP_EOL;
}

// Configure OAuth2 access token for authorization: oAuth2AuthCode
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Swagger\Client\Api\AccountingDepartmentsApi(
    // 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
);
$id = "id_example"; // string | id of the department

try {
    $result = $apiInstance->departmentsIdGet($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountingDepartmentsApi->departmentsIdGet: ', $e->getMessage(), PHP_EOL;
}

// Configure OAuth2 access token for authorization: oAuth2AuthCode
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Swagger\Client\Api\AccountingDepartmentsApi(
    // 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
);
$body = new \Swagger\Client\Model\StockMovements(); // \Swagger\Client\Model\StockMovements | Object data that need to be updated
$id = "id_example"; // string | id of the department that need to be updated

try {
    $result = $apiInstance->departmentsIdPut($body, $id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountingDepartmentsApi->departmentsIdPut: ', $e->getMessage(), PHP_EOL;
}

// Configure OAuth2 access token for authorization: oAuth2AuthCode
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Swagger\Client\Api\AccountingDepartmentsApi(
    // 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
);
$body = new \Swagger\Client\Model\Departments(); // \Swagger\Client\Model\Departments | Department object that needs to be added.

try {
    $result = $apiInstance->departmentsPost($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountingDepartmentsApi->departmentsPost: ', $e->getMessage(), PHP_EOL;
}
?>

API 端点文档

所有 URI 都相对于 https://api.scloby.com/v2

模型文档

授权文档

oAuth2AuthCode

作者

dev@scloby.com