Download the PHP package waotomatis/sdk without Composer

On this page you can find all versions of the php package waotomatis/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

WAOtomatis PHP SDK

Official PHP SDK for WAOtomatis — headless WhatsApp infrastructure on the WhatsApp Business Platform (WABA Cloud API).

Requirements

Install

Quickstart

The client base URL defaults to https://api.waotomatis.com. Authentication is sent as Authorization: Bearer <apiKey>.

Configuration

Transient failures (HTTP 408/429/500/502/503/504 and network errors) are retried with exponential backoff + jitter, honoring the Retry-After header. Only idempotent verbs — or requests carrying an idempotency key — are retried.

Sessions

Sending messages

There is one method per message type — eight in total. Across all of them $to is the first argument, required fields are required arguments, optionals are nullable (and dropped from the wire body when null), and the last argument is always an optional $idempotencyKey. Each posts to its own endpoint and returns ['id' => ..., 'eventId' => ..., 'providerMessageId' => ..., 'status' => ...].

Text

sendText(to, text, previewUrl?, replyTo?, idempotencyKey?)

Media

sendMedia(to, type, mediaId?, link?, caption?, fileName?, voice?, replyTo?, idempotencyKey?)

One method covers image, video, audio, document, and sticker — the media kind is the $type argument. Provide exactly one of $mediaId (from an upload) or $link (a public URL). $caption applies to image/video/document, $fileName to document, and $voice marks audio as a voice note.

Template

sendTemplate(to, name, languageCode, components?, replyTo?, idempotencyKey?)

$components is Meta's component array (header/body/buttons params), passed through as-is.

Interactive

sendInteractive(to, type, bodyText?, headerText?, footerText?, buttons?, listButton?, sections?, ctaDisplayText?, ctaUrl?, flow?, catalogId?, productRetailerId?, productSections?, replyTo?, idempotencyKey?)

One method covers all interactive variants — the variant is the $type argument (button, list, cta_url, flow, product, or product_list). Supply only the fields that variant needs.

Reaction

sendReaction(to, messageId, emoji, idempotencyKey?)

React to a message by its provider wamid. Pass an empty $emoji to clear a reaction you previously sent.

Location

sendLocation(to, latitude, longitude, name?, address?, replyTo?, idempotencyKey?)

Contacts

sendContacts(to, contacts, replyTo?, idempotencyKey?)

$contacts is an array of WhatsApp contact-card objects. Each card requires name.formatted_name; phones, emails, org, urls, addresses, and birthday are optional and passed through as-is.

Carousel

sendCarousel(to, name, languageCode, cards, bodyParams?, replyTo?, idempotencyKey?)

A carousel template: a named, language-tagged template with up to ten cards, each carrying its own media header, body params, and buttons.

Idempotency

Every send method takes an optional $idempotencyKey as its last argument. Pass a key so a retried send returns the original result instead of duplicating:

Mark as read

Media upload & download

Templates

Manage WhatsApp message templates for a session (proxies Meta's WABA template API). Reach them as $wao->sessions('sess_123')->templates.

A template object has the shape { id, name, language, status, category, components, quality_score? }. The components array follows Meta's template-component schema (HEADER/BODY/FOOTER/BUTTONS) and is passed through as-is.

Webhooks

The server signs each delivery with HMAC-SHA256 over the raw request body, hex-encoded, in the X-Wao-Signature: sha256=<hex> header. Verify against the exact bytes you received (never re-encode a parsed object).

constructEvent() throws WaotomatisException (code: unauthorized) on a bad signature and (code: validation_failed) on an unparseable body.

Error handling

Every failure is a subclass of Waotomatis\Exception\WaotomatisException, mirroring the server's { error: { code, message, requestId } } model plus the HTTP status. Branch on getCodeName() for stable handling.

Exception HTTP Notes
AuthenticationError 401 Missing / invalid API key
PermissionError 403 Key not permitted for this action
NotFoundError 404 Resource not found / not visible
ValidationError 409 / 422 Understood but rejected (validation, bad state)
RateLimitError 429 getRetryAfter() returns seconds
ApiError 5xx Unexpected server failure
TimeoutError 408 Request exceeded the configured timeout
ConnectionError Network failure before a response
WaotomatisException other Base class; other 4xx surface here

License

MIT © WAOtomatis. See LICENSE.


All versions of sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-json Version *
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 waotomatis/sdk contains the following files

Loading the files please wait ...