1. Go to this page and download the library: Download smartlyq/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/ */
smartlyq / sdk example snippets
use Smartlyq\SmartlyQ;
$sq = new SmartlyQ(getenv('SMARTLYQ_API_KEY'));
// Who am I?
$me = $sq->account->getMe();
// Generate an image with AI
$image = $sq->images->generate(['prompt' => 'A minimalist product shot of a smart speaker']);
// Publish a social post
$post = $sq->social->createPost([
'text' => 'Hello from the SmartlyQ SDK!',
'account_ids' => ['acc_123'],
]);
$sq = new SmartlyQ('sqk_live_xxxxxxxxxxxx', [ // or omit the key and set SMARTLYQ_API_KEY
'timeout' => 60, // per-request timeout in seconds
'max_retries' => 2, // automatic retries on 429/5xx
]);
$sq->social->createPost($body, [
'idempotency_key' => 'my-unique-key', // safe retries for writes
'profile_id' => 'prof_123', // act on behalf of a managed Profile
'timeout' => 10,
]);