The Squidex PHP library provides access to the Squidex API from JavaScript and TypeScript. Can be used in node and in the browser.
Requires PHP 7 or higher.
API reference documentation is available here.
composer install @squidex/squidex
use Squidex\Client\Configuration;
use Squidex\Client\SquidexClient;
require_once __DIR__ . '/../vendor/autoload.php';
$config = new Configuration();
$config->setClientId('client-id');
$config->setClientSecret('client-secret');
$config->setAppName('my-app');
// $config->setHost('https://your.squidex-deployment');
$client = new SquidexClient($config);
$response = $client->rules()->runRule("rule-id", true);
echo "Received response from Squidex!\n$response\n";
When the API returns a non-success status code (4xx or 5xx response), a subclass of ApiException will be thrown:
use Squidex\Client\ApiException;
try {
$response = $client->rules()->runRule("rule-id", true);
} catch (err) {
if (ApiException $) {
echo $e->getMessage();
}
}
While we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!
On the other hand, contributions to the README are always very welcome!