Official PHP SDK for the AskHinton CRM API.

Maintainers

Package info

github.com/askhinton/askhinton-php

Homepage

pkg:composer/askhinton/sdk

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-06-01 11:58 UTC

This package is auto-updated.

Last update: 2026-06-01 12:04:24 UTC


README

Official PHP SDK for the AskHinton CRM API.

composer require askhinton/sdk

Requires PHP 8.1+, ext-curl, ext-json. No other runtime deps.

Quickstart

<?php
use AskHinton\Client;

$ah = new Client(['apiKey' => getenv('ASKHINTON_KEY')]);

// Single page
$page = $ah->companies()->list(after: null, limit: 25);
foreach ($page['items'] as $c) echo $c['name'], "\n";
echo "next cursor: ", ($page['nextCursor'] ?? '(end)'), "\n";

// Auto-paginated iterator
foreach ($ah->leads()->iter() as $lead) echo $lead['companyName'], "\n";

// Create a record
$new = $ah->companies()->create(['name' => 'Acme Corp', 'industry' => 'SaaS']);
echo $new['id'];

What's covered

  • $ah->companies()list, get, create, iter, contacts, iterContacts
  • $ah->leads()list, get, create, iter
  • $ah->opportunities()list($status?), get, iter($status?)
  • $ah->activities()list, iter
  • $ah->tasks()list($activeOnly?), get, iter($activeOnly?)
  • $ah->pipelines()list, get, iter

iter() is a PHP generator that handles cursor pagination automatically.

Errors

use AskHinton\AskHintonError;
try { $ah->companies()->get('not-real'); }
catch (AskHintonError $e) {
    error_log("HTTP {$e->status}: " . json_encode($e->body));
}

License

Apache-2.0.