nsbucky/echosign

Adobe Echosign REST API的库

v0.1-beta 2015-01-30 04:37 UTC

This package is auto-updated.

Last update: 2024-09-18 16:52:53 UTC


README

处理adobe echosign REST API v2的库。您可以在以下位置查看API文档: https://secure.echosign.com/public/docs/restapi/v2

Api v3

此库将不支持Echosign的新版v3。请查看nsbucky/echosignv3以获取正在进行的工作。

需求

PHP 5.4,php ext-filter。使用guzzlehttp作为传输,但也可以根据需要插入其他传输。

请查看测试以了解如何使用此库。它与echosign REST API的请求和响应几乎是1对1的。

安装

composer.json文件的require键中添加以下内容

"nsbucky/echosign": "dev-master"

用法

// get a token from Echosign
use Echosign\Token;
$token = new Token($appId, $appSecret, $apiKey);
$token->authenticate();

// upload a transient document
use Echosign\TransientDocument;
$document = new TransientDocument($token, '/path/to/file/sample.pdf', 'application/pdf');
$document->send();

// create an agreement
use Echosign\Agreement;
use Echosign\Info\DocumentCreationInfo;
$agreement = new Agreement($token);
$fileInfos = new FileInfo();
$docInfo = new DocumentCreationInfo( $fileInfos, 'test', \Echosign\Info\DocumentCreationInfo::SIGN_ESIGN, \Echosign\Info\DocumentCreationInfo::FLOW_NOT_REQUIRED );
$docinfo->addRecipient('user@gmail.com');
$docInfo->addTransientDocument($document);
$response = $agreement->create($docInfo);