定制 unified/unified-to 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

unified/unified-to

Composer 安装命令:

composer require unified/unified-to

包简介

README 文档

README

SDK Installation

The SDK relies on Composer to manage its dependencies.

To install the SDK and add it as a dependency to an existing composer.json file:

composer require "unified/unified-to"

SDK Example Usage

Example

declare(strict_types=1);

require 'vendor/autoload.php';

use Unified\Unified_to;
use Unified\Unified_to\Models\Operations;
use Unified\Unified_to\Models\Shared;

$sdk = Unified_to\UnifiedTo::builder()
    ->setSecurity(
        '<YOUR_API_KEY_HERE>'
    )
    ->build();

$request = new Operations\CreateAccountingAccountRequest(
    accountingAccount: new Shared\AccountingAccount(),
    connectionId: '<id>',
);

$response = $sdk->accounting->createAccountingAccount(
    request: $request
);

if ($response->accountingAccount !== null) {
    // handle response
}

Authentication

Per-Client Security Schemes

This SDK supports the following security scheme globally:

Name Type Scheme
jwt apiKey API key

To authenticate with the API the jwt parameter must be set when initializing the SDK. For example:

declare(strict_types=1);

require 'vendor/autoload.php';

use Unified\Unified_to;
use Unified\Unified_to\Models\Operations;
use Unified\Unified_to\Models\Shared;

$sdk = Unified_to\UnifiedTo::builder()
    ->setSecurity(
        '<YOUR_API_KEY_HERE>'
    )
    ->build();

$request = new Operations\CreateAccountingAccountRequest(
    accountingAccount: new Shared\AccountingAccount(),
    connectionId: '<id>',
);

$response = $sdk->accounting->createAccountingAccount(
    request: $request
);

if ($response->accountingAccount !== null) {
    // handle response
}

Available Resources and Operations

Available methods

Account

Accounting

Activity

Ad

Ads

Analytics

Apicall

Application

Applicationstatus

Assessment

Ats

Auth

Availability

Balancesheet

Bankaccount

Benefit

Bill

Branch

Busy

Calendar

Call

Campaign

Candidate

Carrier

Cashflow

Category

Change

Channel

Class

Clubs

Collection

Comment

Commerce

Commit

Company

Connection

Contact

Content

Course

Creative

Creditmemo

Crm

Customer

Database

Datastore

Deal

Deduction

Device

Document

Embedding

Employee

Enrich

Environment

Event

Expense

File

Form

Forms

Genai

Group

Hris

Insertionorder

Instructor

Integration

Interview

Inventory

Invoice

Issue

Item

Itemvariant

Job

Journal

Kms

Label

Lead

Link

List

Lms

Location

Login

Martech

Member

Message

Messaging

Metadata

Model

Note

Order

Organization

Package

Page

Passthrough

Payment

Payout

Payslip

Person

Picklist

Pipeline

Profitloss

Project

Promoted

Prompt

Property

Pullrequest

Purchaseorder

Query

Rate

Record

Recording

Refund

Repo

Report

Repository

Request

Reservation

Review

Saleschannel

Salesorder

Scim

Scorecard

Secretsmanager

Session

Shipment

Shipping

Signatory

Signing

Space

Storage

Student

Submission

Subscription

Table

Target

Task

Taxonomy

Taxrate

Template

Ticket

Ticketing

Timeoff

Timeshift

Tracking

Transaction

Trialbalance

Uc

Unified

User

Vendorcredit

Verification

Visitor

Webhook

Webinar

Error Handling

Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception.

By default an API error will raise a Errors\SDKException exception, which has the following properties:

Property Type Description
$message string The error message
$statusCode int The HTTP status code
$rawResponse ?\Psr\Http\Message\ResponseInterface The raw HTTP response
$body string The response content

When custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective Errors tables in SDK docs for more details on possible exception types for each operation. For example, the createAccountingAccount method throws the following exceptions:

Error Type Status Code Content Type
Errors\SDKException 4XX, 5XX */*

Example

declare(strict_types=1);

require 'vendor/autoload.php';

use Unified\Unified_to;
use Unified\Unified_to\Models\Operations;
use Unified\Unified_to\Models\Shared;

$sdk = Unified_to\UnifiedTo::builder()
    ->setSecurity(
        '<YOUR_API_KEY_HERE>'
    )
    ->build();

try {
    $request = new Operations\CreateAccountingAccountRequest(
        accountingAccount: new Shared\AccountingAccount(),
        connectionId: '<id>',
    );

    $response = $sdk->accounting->createAccountingAccount(
        request: $request
    );

    if ($response->accountingAccount !== null) {
        // handle response
    }
} catch (Errors\SDKException $e) {
    // handle default exception
    throw $e;
}

Server Selection

Select Server by Index

You can override the default server globally using the setServerIndex(int $serverIdx) builder method when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:

# Server Description
0 https://api.unified.to North American data region
1 https://api-eu.unified.to European data region
2 https://api-au.unified.to Australian data region

Example

declare(strict_types=1);

require 'vendor/autoload.php';

use Unified\Unified_to;
use Unified\Unified_to\Models\Operations;
use Unified\Unified_to\Models\Shared;

$sdk = Unified_to\UnifiedTo::builder()
    ->setServerIndex(0)
    ->setSecurity(
        '<YOUR_API_KEY_HERE>'
    )
    ->build();

$request = new Operations\CreateAccountingAccountRequest(
    accountingAccount: new Shared\AccountingAccount(),
    connectionId: '<id>',
);

$response = $sdk->accounting->createAccountingAccount(
    request: $request
);

if ($response->accountingAccount !== null) {
    // handle response
}

Override Server URL Per-Client

The default server can also be overridden globally using the setServerUrl(string $serverUrl) builder method when initializing the SDK client instance. For example:

declare(strict_types=1);

require 'vendor/autoload.php';

use Unified\Unified_to;
use Unified\Unified_to\Models\Operations;
use Unified\Unified_to\Models\Shared;

$sdk = Unified_to\UnifiedTo::builder()
    ->setServerURL('https://api-au.unified.to')
    ->setSecurity(
        '<YOUR_API_KEY_HERE>'
    )
    ->build();

$request = new Operations\CreateAccountingAccountRequest(
    accountingAccount: new Shared\AccountingAccount(),
    connectionId: '<id>',
);

$response = $sdk->accounting->createAccountingAccount(
    request: $request
);

if ($response->accountingAccount !== null) {
    // handle response
}

Summary

Unified.to API: One API to Rule Them All

For more information about the API: API Documentation

Table of Contents

Maturity

This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.

Contributions

While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!

SDK Created by Speakeasy

unified/unified-to 适用场景与选型建议

unified/unified-to 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 353.58k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2023 年 09 月 21 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 unified/unified-to 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 unified/unified-to 我们能提供哪些服务?
定制开发 / 二次开发

基于 unified/unified-to 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 353.58k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-09-21