PHP code example of hacocms / hacocms-php-sdk

1. Go to this page and download the library: Download hacocms/hacocms-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/ */

    

hacocms / hacocms-php-sdk example snippets


$client = new HacoCMS\V1\HacoCMSApiClient('subdomain', 'access_token');
// https://[subdomain].hacocms.com/api/v1/[endpoint]
$res = $client->list('endpoint');

$client = new HacoCMS\V1\HacoCMSApiClient('subdomain', 'access_token');
// https://[subdomain].hacocms.com/api/v1/[endpoint]/[content_id]
$res = $client->listSingleContent('endpoint', 'content_id');

$client = new HacoCMS\V1\HacoCMSApiClient('subdomain', 'access_token');
// https://[subdomain].hacocms.com/api/v1/[endpoint]
$res = $client->single('endpoint');

$client = new HacoCMS\V1\HacoCMSApiClient('subdomain', 'access_token', 'project-draft-token');