PHP code example of craymend / hotdocs-advance-php-sdk
1. Go to this page and download the library: Download craymend/hotdocs-advance-php-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
craymend / hotdocs-advance-php-sdk example snippets
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);
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);