Download the PHP package crunchzapp/crunchzapp-php-sdk without Composer
On this page you can find all versions of the php package crunchzapp/crunchzapp-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download crunchzapp/crunchzapp-php-sdk
More information about crunchzapp/crunchzapp-php-sdk
Files in crunchzapp/crunchzapp-php-sdk
Package crunchzapp-php-sdk
Short Description Official PHP SDK for CrunchzApp WhatsApp Business API - Send messages, manage contacts, groups, and OTP verification
License MIT
Homepage https://crunchz.app
Informations about the package crunchzapp-php-sdk
CrunchzApp - WhatsApp PHP SDK
CrunchzApp - WhatsApp PHP SDK provides a comprehensive and easy-to-use interface for integrating WhatsApp automation into your PHP applications using the CrunchzApp API. This SDK enables developers to send messages, manage contacts, handle OTP authentication, manage groups and chats, and automate WhatsApp interactions with minimal effort.
๐ Features
- ๐ฑ Message Management: Send text, images, videos, voice messages, locations, and reactions
- ๐ OTP Services: Generate and validate OTP codes and links
- ๐ฅ Contact Management: Retrieve contact details, pictures, and manage contact lists
- ๐ฌ Chat Management: Archive/unarchive chats and retrieve chat details
- ๐จโ๐ฉโ๐งโ๐ฆ Group Management: Create groups, manage participants, and retrieve group information
- โก Batch Operations: Send multiple requests in parallel using HTTP pools
- ๐ก๏ธ Type Safety: Full type hints and comprehensive error handling
- ๐ง Laravel Integration: Native Laravel service provider and configuration
๐ Requirements
- PHP 8.0 or higher
- Laravel 9.0 or higher
- Illuminate HTTP Client
- Valid CrunchzApp API token
๐ฆ Installation
You can install the package via Composer:
For Laravel Users
The package will be automatically discovered and registered in Laravel applications.
-
Publish the configuration file:
This will create a
config/crunchzapp.phpfile in your application that you can modify to configure the SDK. -
Set your API Token:
Add your CrunchzApp API token to your
.envfile. You can get your token from the CrunchzApp Dashboard.
For Non-Laravel Users
If you are not using Laravel, you can instantiate the CrunchzApp class manually:
๐ง Basic Usage
Sending Messages
Batch Operations
OTP Services
Code-based OTP
Link-based OTP
Contact Management
Chat Management
Group Management
Advanced Message Features
๐ก๏ธ Error Handling
The SDK provides comprehensive error handling:
๐ง Configuration
The configuration file config/crunchzapp.php allows you to customize:
- API Settings: Timeout, base URL, authentication token
- OTP Configuration: Length, character sets, expiration times
- Message Templates: Success/failure messages, prompts
- Callback URLs: Success and failure webhook endpoints
๐ API Reference
The SDK is designed to be fluent, allowing you to chain methods together to build your requests.
CrunchzApp
The main entry point of the SDK.
new CrunchzApp(?string $token = null): Creates a new SDK instance. The token is optional if you have it configured in your.envfile (for Laravel users).channel(): ChannelService: Returns an instance of theChannelServicefor handling messaging, contacts, groups, and chats.otp(string $type): OtpService: Returns an instance of theOtpServicefor handling One-Time Passwords. The$typecan be either'code'or'link'.
ChannelService
Provides methods for all channel-related interactions.
Execution Methods:
send(): array: Sends a single request. This should be the last method in a chain for single requests.sendPool(): array: Sends multiple requests in parallel.
Messaging:
contact(string $contactId): Sets the recipient's contact ID.text(string $message): Sends a plain text message.image(string $url, ?string $caption = null, ...): Sends an image from a URL.video(string $videoUrl, ?string $caption = null): Sends a video from a URL.voice(string $audioUrl): Sends a voice message from a URL.location(float $latitude, float $longitude, ?string $title = null): Sends a location.react(string $messageId, string $reaction): Reacts to a specific message.polling(string $title, array $options, bool $isMultipleAnswer = false): Creates a poll.star(string $messageId, bool $starred = true): Stars or unstars a message.delete(string $messageId): Deletes a message.seen(string $messageId): Marks a message as seen.startTyping(): Shows a "typing..." indicator in the chat.stopTyping(): Hides the "typing..." indicator.
Contact Management:
allContact(): Retrieves a list of all contacts.detail(string $contactId): Gets detailed information about a specific contact.picture(string $contactId): Gets the profile picture URL of a contact.checkPhoneNumber(string $phoneNumber, bool $toVariable = false): Checks if a phone number is registered on WhatsApp.
Chat Management:
allChat(): Retrieves a list of all chats.chatDetail(string $contactId): Gets detailed information about a specific chat.archiveChat(string $contactId): Archives a chat.unArchiveChat(string $contactId): Unarchives a chat.
Group Management:
allGroup(): Retrieves a list of all groups.createGroup(string $name, array $participants): Creates a new group.participants(string $groupId): Retrieves the list of participants in a group.
OtpService
Provides methods for sending and validating OTPs.
contact(string $contactId): Sets the recipient's contact ID for the OTP.send(): array: Sends the configured OTP.validate(string $code): array: Validates a code-based OTP.code(string $code): Sets the code for validation (for code-based OTP).prompt(string $message): Sets a custom prompt message (for link-based OTP).responseMessage(?string $success, ?string $failed, ?string $expired): Sets custom success, failure, and expired messages (for link-based OTP).callback(?string $successUrl, ?string $failedUrl): Sets callback URLs for success and failure events (for link-based OTP).
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
๐ License
This package is open-sourced software licensed under the MIT license.
๐ Links
- Official Documentation: https://crunczhapp.readme.io/reference/laravel-php
- Website: https://www.crunchz.app
- Support: Contact Support
๐ฐ Special Offer
Register and use voucher code "25OFFCRZAPP" to get 25% OFF your subscription!
Made with โค๏ธ by the CrunchzApp Team
All versions of crunchzapp-php-sdk with dependencies
illuminate/support Version ^9.0|^10.0|^11.0
illuminate/http Version ^9.0|^10.0|^11.0