PHP
PHP SDK
Modern PHP SDK with PSR-18 HTTP client support.
$composer require appneural/appneural-php
PSR-18 HTTP clientPSR-3 logger supportPHP 8.2+ compatibleNamed arguments supportEnum-based configurationGenerator-based streaming
Code
Get started in minutes.
initialization.php
use Appneural\Client;
$client = new Client([
'api_key' => getenv('APPNEURAL_API_KEY'),
'environment' => 'production',
]);authentication.php
// API key
$client = new Client(['api_key' => getenv('APPNEURAL_API_KEY')]);
// OAuth 2.0
$client = new Client([
'oauth' => [
'client_id' => getenv('APPNEURAL_CLIENT_ID'),
'client_secret' => getenv('APPNEURAL_CLIENT_SECRET'),
],
]);usage example.php
$run = $client->workflows->trigger([
'workflowId' => 'wf_invoice_audit_01',
'input' => [
'documentUrl' => 'https://storage.example.com/invoices/inv_001.pdf',
'validationRules' => ['vat_matching'],
],
]);
echo "Workflow started: {$run->id}";Configuration
SDK options.
| Option | Type | Description |
|---|---|---|
| api_key | string | Your API key |
| environment | string | production | sandbox |
| timeout | int | Request timeout in seconds |
| max_retries | int | Max retry attempts |
Best Practices
Recommended patterns.
Use environment variables for secrets
Use named arguments for clarity
Implement proper exception handling
Use generators for streaming
Enterprise Intelligence
Get started with PHP SDK.
Modern PHP SDK with PSR-18 HTTP client support.
Scope and availability confirmed individually · Written terms define the engagement