Download the PHP package telmodev/cloud-api-whatsapp without Composer

On this page you can find all versions of the php package telmodev/cloud-api-whatsapp. 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 cloud-api-whatsapp

Laravel WhatsApp Cloud API Client

Latest Version on Packagist Total Downloads

A simple, clean, and elegant Laravel package to interact with the Meta WhatsApp Cloud API.

Features

Requirements

Installation

Install the package via Composer:

The Service Provider and Facade are registered automatically via Laravel's package auto-discovery. No manual changes to config/app.php are needed.

Publish the configuration file

This creates config/cloud-api-whatsapp.php in your project with all available options.

Publish the AI agent skill

The package ships the SDK documentation as an Agent Skill (open SKILL.md standard), so AI coding assistants (Claude Code, opencode, Codex, ChatGPT, Cursor, Gemini CLI, Antigravity, etc.) can implement the SDK correctly without browsing the source.

Install it for your provider:

Each tag copies the skill into the provider's skill directory in your project:

Tag Installed to Providers that read it
...-claude .claude/skills/cloud-api-whatsapp/ Claude Code
...-opencode .opencode/skills/cloud-api-whatsapp/ opencode
...-codex .agents/skills/cloud-api-whatsapp/ OpenAI Codex
...-chatgpt .agents/skills/cloud-api-whatsapp/ ChatGPT
...-cursor .cursor/skills/cloud-api-whatsapp/ Cursor
...-gemini .gemini/skills/cloud-api-whatsapp/ Gemini CLI
...-antigravity .agents/skills/cloud-api-whatsapp/ Google Antigravity
cloud-api-whatsapp-agents (combined) .agents/skills/cloud-api-whatsapp/ opencode, Codex, ChatGPT, Cursor, Gemini CLI, Antigravity

The combined tag installs to the shared .agents/skills/ location that most tools read. Claude Code does not read .agents/skills — use cloud-api-whatsapp-agents-claude if you use Claude Code.

Configuration

Add these variables to your .env file:

WHATSAPP_BUSINESS_ACCOUNT_ID is required for template management endpoints. All other template and messaging endpoints only need WHATSAPP_PHONE_NUMBER_ID.


Usage

All examples use the CloudApiWhatsapp facade. You can also resolve the class via dependency injection.


Text Messages

Reply to a Message

Quote a previous message in the conversation thread.

Emoji Reactions

React to a received message. Pass an empty string to remove an existing reaction.

Template Messages

Required for business-initiated conversations (outside the 24-hour customer window).


Interactive Messages

Reply Buttons (up to 3)

List Menu


Media

You can send media using a public URL or a Meta Media ID obtained after uploading.

Images

Documents

Video

Audio

Stickers

Stickers must be in .webp format.

Upload, retrieve, and delete media


Location

Contacts

Mark as Read

Raw Payload

For advanced use cases not covered by a dedicated method:


Business Profile


Template Management

Requires WHATSAPP_BUSINESS_ACCOUNT_ID to be set.


Webhooks

1. Verify the webhook subscription (GET endpoint)

Meta sends a GET request to your webhook URL to verify ownership. Return the challenge value as a plain text response.

2. Process incoming events (POST endpoint)

Meta sends a POST request with an HMAC-SHA256 signature in the X-Hub-Signature-256 header. Always verify it before processing.


Error Handling

Every API method returns an Illuminate\Http\Client\Response object. The SDK does not throw exceptions on 4xx/5xx responses from Meta — you decide how to handle them.

Checking the response

Common Meta error codes

Code Meaning Action
0 Unknown / generic error Check message for details
10 App does not have permission Review app permissions in Meta dashboard
100 Invalid parameter Check the request payload
130429 Rate limit hit Back off and retry after a delay
131030 Recipient phone number not on WhatsApp Verify the number before sending
131047 Re-engagement message not allowed Send a template to re-open the window
131051 Message type unsupported for this recipient Try a different message type
190 Access token expired or invalid Refresh or regenerate the token

Throwing on failure

If you prefer exceptions over manual checks, chain ->throw():

Network errors

Timeouts and connection failures throw Illuminate\Http\Client\ConnectionException regardless of the ->throw() chain. Catch it at the boundary where you call the SDK:

SDK-level exceptions

InvalidArgumentException is thrown before any HTTP request is made in these cases:

These are programmer-configuration errors. They should surface during development, not be silently swallowed in production.


Dynamic Configuration (Multi-tenant)

Override the default token or phone number ID per request. The facade returns a cloned instance — the singleton is never mutated.


Testing

Since the package uses Laravel's native HTTP client, testing requires no real API connections:

Run the package's own test suite:


License

The MIT License (MIT). Please see the License File for more information.


All versions of cloud-api-whatsapp with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2|^8.3
illuminate/support Version ^10.0|^11.0|^12.0|^13.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 telmodev/cloud-api-whatsapp contains the following files

Loading the files please wait ...