Download the PHP package sendkuy/sdk without Composer

On this page you can find all versions of the php package sendkuy/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sdk

SendKuy PHP SDK

SendKuy PHP SDK

Send WhatsApp, SMS and email from PHP with one API key, and retry without ever sending twice.

Latest version Downloads CI

Baca dalam Bahasa Indonesia

Install

PHP 8.2 or newer. Building on Laravel? Install sendkuy/laravel instead: it adds a facade, a notification channel and a signed webhook route on top of this package.

Quickstart

Create a key in the SendKuy dashboard under Developers → Keys. Numbers go in E.164 form, with the leading +. You get one message back per recipient.

Every endpoint has a method

Field names are the API's own, so every example in the API reference maps one to one onto this SDK.

Group Methods
account() get, usage
messages() list, send, sendBatch, get, cancel, resend
numbers() check
verifications() create, get, check
jobs() get
contacts() list, create, bulkImport, lookup, get, update, delete, listAttributes
groups() list, create, get, update, delete, addContacts, removeContacts
templates() list, create, get, update, delete
gateways() list, get
webhooks() list, create, get, update, delete, listDeliveries
campaigns() list, create, get, update, delete, listDispatches, start, pause, resume, cancel
conversations() list, get, listMessages, markRead, reply
workflows() list, get, listExecutions, trigger
executions() get

Objects come back with their fields as properties ($message->status) and as array keys ($message['status']), and your editor autocompletes them. An endpoint newer than your SDK version is still one call away:

Retries and idempotency

A timeout tells you nothing about whether a message went out. That is why every write this SDK sends carries an Idempotency-Key, and every retry of that call reuses it: if the first attempt did go through, SendKuy answers the retry with the first result instead of sending again.

The SDK retries connection errors, timeouts, 429 (waiting for Retry-After when it is a minute or less), 5xx and 409 idempotency_request_in_progress, up to twice, with exponential backoff.

When your own code retries, for example a queued job, pass a key derived from something stable in your system:

Option Default
base_url https://app.sendkuy.com/api/v1
timeout 30 seconds; also per request: ['timeout' => 10]
max_retries 2
http_client Guzzle any PSR-18 client

Pagination

Errors

Every failure is a SendKuy\Exceptions\SendKuyException. Branch on the stable code, never on the message:

Exception When
AuthenticationException the key is missing, wrong, revoked or expired
AuthorizationException the key lacks a scope, or the plan lacks the channel
InvalidRequestException validation, not found, idempotency conflicts
RateLimitException too many requests
ApiException SendKuy failed on its side
ConnectionException SendKuy could not be reached

Webhooks

SendKuy signs every webhook. Verify it against the raw body, before any JSON parsing:

Use the endpoint secret in full, whsec_ included, and answer within 10 seconds. Slow work belongs in a queue.

Self-hosted SendKuy

Testing your code

Pass any PSR-18 client and the SDK sends through it:

A client you pass in owns its own timeouts.

Links

License

MIT. See LICENSE.


All versions of sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
guzzlehttp/guzzle Version ^7.8.2|^8.0
guzzlehttp/psr7 Version ^2.9|^3.0
psr/http-client Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sendkuy/sdk contains the following files

Loading the files please wait ...