Explore WhatsApp integrations with Z-API using PHP's cURL extension. Browse request examples and adapt them to your own application.
Explore the Examples · Read the Documentation
The examples are collected in curl.txt, alongside sample responses and notes in Portuguese.
These are individual PHP snippets, not a standalone application or a shell script.
Examples cover:
- QR code retrieval.
- Sending audio, video, documents, and links.
- Marking messages as read.
- Publishing text and image status updates.
- Retrieving chats and contacts.
- Checking whether a phone number has WhatsApp.
- Creating groups and managing group administrators.
Refer to the current documentation for endpoint availability and request requirements.
- PHP with the cURL extension enabled.
- A Z-API account.
- Your Z-API instance credentials.
- A connected WhatsApp instance for operations that require it.
git clone https://github.com/Z-API/whatsapp-api-curl.git
cd whatsapp-api-curlYou can also open curl.txt directly on GitHub.
Find the endpoint you want to explore in curl.txt.
Copy only its PHP code into a separate file, such as example.php. Exclude endpoint headings, sample responses, and explanatory notes.
Replace the placeholders with your own values:
| Placeholder | Replace with |
|---|---|
MINHA_INSTANCE |
Your Z-API instance ID |
MEU_TOKEN |
Your Z-API instance token |
| Sample phone numbers | Your intended recipient or test number |
| Sample payload values | Your message, media, or other request data |
Check the current documentation and add any required authentication headers before running the request.
Some snippets disable TLS certificate verification. Remove those overrides and keep certificate verification enabled.
Once you have reviewed the endpoint, credentials, and payload, run your file:
php example.phpInspect the response and compare it with the current endpoint documentation.
This collection contains historical examples and testing notes. Request fields, authentication requirements, response formats, and HTTP status codes may have changed.
Some media payloads are shortened for illustration and must be replaced with complete values.
Use the examples as a reference, and consult the documentation when adapting them.
Found an outdated example or an opportunity to improve clarity? Open an issue or submit a pull request with the endpoint and proposed change.
Use placeholders for credentials and personal data in all contributions.
This repository is licensed under the GNU General Public License v3.0. See LICENSE for details.