1. Go to this page and download the library: Download garchicms/garchi-sdk-php 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/ */
garchicms / garchi-sdk-php example snippets
use GarchiCMS\GarchiCMS;
$garchi = new GarchiCMS("YOUR_API_KEY");
$result = $garchi->dataItem->updateWithStatus([
'item_id' => 51,
'space_uid' => 'your_space_uid',
'name' => 'Winter coat',
]);
// $result['has_draft'] === true: saved as unpublished changes, the published item is unchanged
$result = $garchi->dataItem->updateWithStatus(['item_id' => 51, 'space_uid' => 'your_space_uid', 'make_public' => true]);
// publishes them; on a 409, $result['message'] says why they could not be published
// The published items inside a product, in their order
$variants = $garchi->dataItem->getChildren(['uid' => 'your_space_uid', 'item' => 'oak-table']);
// A product with its variants in one call
$product = $garchi->dataItem->get(['item' => 'oak-table', 'children' => ' => ['field' => 'parent_id', 'op' => 'not_exists']]);