承接 craymend/hotdocs-advance-php-sdk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

craymend/hotdocs-advance-php-sdk

Composer 安装命令:

composer require craymend/hotdocs-advance-php-sdk

包简介

Php SDK for HotDocs Advance REST API

README 文档

README

Software License

Query HotDocs API

Installation

Via composer.

composer require craymend/hotdocs-advance-php-sdk

API Usage Example - GET

use Craymend\HotDocsAdvancePhpSdk\Api\WorkItem;

// creds
$tenancy = 'xxxxxx';
$baseUrl = 'hotdocsadvance.com/api/rest/v1.1';
$clientName = 'xxxxxx';
$principalName = 'xxxxxx';
$principalPassword ='xxxxxx'; 

// $curlOptions = [];

$api = new WorkItem(
    $tenancy,
    $baseUrl,
    $clientName,
    $principalName,
    $principalPassword,
    $curlOptions
);

// set access token for API calls
$api->authenticate();

$workItemId = 'xxxxxx';

// set item id for API call
$api->id = $workItemId;

// send request to API
$data = $api->getWorkItem();

echo json_encode($data);

API Usage Example - PUT

use Craymend\HotDocsAdvancePhpSdk\Api\WorkItem;

// creds
$tenancy = 'xxxxxx';
$baseUrl = 'hotdocsadvance.com/api/rest/v1.1';
$clientName = 'xxxxxx';
$principalName = 'xxxxxx';
$principalPassword ='xxxxxx'; 

// $curlOptions = [];

$api = new WorkItem(
    $tenancy,
    $baseUrl,
    $clientName,
    $principalName,
    $principalPassword,
    $curlOptions
);

// set access token for API calls
$api->authenticate();

$workGroupId = 'xxxxxxx';
$templatePackageId = 'xxxxxxx';

// uuid for new work item
$newUuid = $api->createUuid();

// send request to API
$data = $api->createWorkItem($newUuid, [
    "workGroupId" => $workGroupId,
    "name" => "Test Work Item",
    "description" => "For testing SDK",
    "templatePackageId" => $templatePackageId,
    "answerXml" => "",
    "assembleImmediately" => true,
    "completeAssemblySession" => true,
    "isPrivateToOwner" => true
]);

echo json_encode($data);

API Usage Example - Download File

use Craymend\HotDocsAdvancePhpSdk\Api\Document;

// creds
$tenancy = 'xxxxxx';
$baseUrl = 'hotdocsadvance.com/api/rest/v1.1';
$clientName = 'xxxxxx';
$principalName = 'xxxxxx';
$principalPassword ='xxxxxx'; 

// $curlOptions = [];

$api = new Document(
    $tenancy,
    $baseUrl,
    $clientName,
    $principalName,
    $principalPassword,
    $curlOptions
);

// set access token for API calls
$api->authenticate();

$fileName = date('YmdHis') . '_' . uniqid() . '.docx';
$filePath = __DIR__ . '/hotdocs-tmp';

$workItemId = 'xxxxxx';
$documentId = 'xxxxxx';

$api->id = $documentId;

// stores file contents in the provided file location
$ret = $api->getWorkItemDocumentContent($workItemId, $filePath, $fileName);

// return file to client
header('Content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.document');
header('Content-Disposition: attachment; filename="' . $fileName . '"');
readfile($filePath . '/' . $fileName);

License

The MIT License (MIT).

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-11-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固