Search by

nsupp / rest

Official PHP SDK for the nsupp /cof/v1 REST API (zero dependencies, cURL). HTTP Basic + X-Cof-Tier auth, envelope handling, website-scoped helpers.

Maintainers

Package info

github.com/asindie-dev/nsupp-php

pkg:composer/nsupp/rest

Transparency log

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-08-21 08:58 UTC

This package is auto-updated.

Last update: 2026-09-03 20:52:06 UTC


README

Typed, dependency-free client for the nsupp /cof/v1 REST API (PHP 8.1+, ext-curl).

Handles HTTP Basic auth + the X-Cof-Tier header, unwraps the { error, data } envelope, throws Nsupp\NsuppError on failures, and gives you a website-scoped helper. Every endpoint is reachable — common ones as typed methods, the rest via request().

Install

composer require nsupp/rest

Quickstart

use Nsupp\Client;
use Nsupp\NsuppError;

$nsupp = new Client([
    'identifier' => getenv('NSUPP_IDENTIFIER'), // nsupp_pk_…
    'secret'     => getenv('NSUPP_SECRET'),
    'tier'       => 'plugin',
    'websiteId'  => '8f3c1d…',
    // 'baseUrl' => 'https://api.nsupp.com/cof',
]);

$site = $nsupp->website();

$website = $site->get();
$convos  = $site->listConversations(['page' => 1]);
$site->sendMessage('session_1', 'Hi šŸ‘‹ — how can we help?');

// Connected-channel delivering replies (ticket / mail / marketplace / review):
$site->emailReply('session_1', 'Thanks — your order ships today.');
$site->marketplaceReply('session_2', 'It ships within 24 hours.');
$site->reviewReply('session_3', 'Thank you for the feedback!');

try {
    $site->getConversation('missing');
} catch (NsuppError $e) {
    error_log("{$e->status} {$e->errorCode} {$e->getMessage()}");
}

// Escape hatch — any endpoint:
$site->request('POST', '/helpdesk/article/a_1/alternate', ['body' => ['alternate_article_id' => 'a_2']]);

Run the self-test: composer test (or php tests/contract.php).

License

Licensed under the Apache License 2.0.

"nsupp" and the nsupp logo are trademarks of Asindie, Inc. The license grants no trademark rights — see the trademark policy for what use is permitted.