Download the PHP package ultramsg/whatsapp-php-sdk without Composer
On this page you can find all versions of the php package ultramsg/whatsapp-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ultramsg/whatsapp-php-sdk
More information about ultramsg/whatsapp-php-sdk
Files in ultramsg/whatsapp-php-sdk
Package whatsapp-php-sdk
Short Description Lightweight PHP library for WhatsApp API to send the whatsappp messages in PHP provided by ultramsg.com
License MIT
Homepage https://ultramsg.com
Rated 5.00 based on 1 reviews
Informations about the package whatsapp-php-sdk
Ultramsg.com WhatsApp API PHP SDK
Lightweight PHP library for WhatsApp API to send the whatsappp messages in PHP provided by Ultramsg.com
Installation
Just download ultramsg.class.php or use Composer:
Example usage
NOTE: you need replace instance_id and token with yours in ultramsg.com account if you don't have account create one from here
Youtube
Send Message
- $to : your number for testing with international format e.g. +14155552671 or chatID for contact or group e.g [email protected] or [email protected]
- $body : Message text, UTF-8 or UTF-16 string with emoji .
- $priority : This parameter is optional,
You can use it to create a professional queue for messages, The Messages with less priority value are sent first.
example of usage :
priority = 0: for High priority like OTP messages.
priority = 5: used with general messages.
priority =10: Non-urgent promotional offers and notifications to your customers.
Default value : 10
- $referenceId : Your custom reference ID for this message.
Send Image
- $caption : image Caption, UTF-8 or UTF-16 string with emoji .
- $image : HTTP link image or base64-encoded file
Supported extensions ( jpg , jpeg , gif , png , svg , webp , bmp ) .
Max file size : 16MB .
Max Base64 length : 10,000,000
- $nocache : default false
false : use a previously uploaded file instead of uploading it with each request
true : uploading it each request
Send Sticker
- $sticker : HTTP link image or base64-encoded file
Supported extensions ( jpg , jpeg , gif , png , svg , webp , bmp ) .
Max file size : 16MB .
Max Base64 length : 10,000,000
- $nocache : default false
false : use a previously uploaded file instead of uploading it with each request
true : uploading it each request
Send Document
- $filename : File name, for example 1.jpg or Hello.pdf
- $caption : Document Caption, UTF-8 or UTF-16 string with emoji .
- $document : HTTP link file or base64-encoded file
Supported most extensions like ( zip , xlsx , csv , txt , pptx , docx ....etc ) .
Max file size : 100MB .
Max Base64 length : 10,000,000
Send Audio
- $audio : HTTP link audio or base64-encoded audio
Supported extensions ( mp3 , aac , ogg ) .
Max file size : 16MB .
Max Base64 length : 10,000,000
Send Voice
- $audio : HTTP link audio ogg-file with opus codec or base64 ogg-file in opus codec
Max file size : 16MB .
Max Base64 length : 10,000,000
Send Video
- $video : HTTP link video or base64-encoded video
Supported extensions ( mp4 , 3gp , mov ) .
Max file size : 16MB .
Max Base64 length : 10,000,000
Send Link
- $link : HTTP or HTTPS link
Send Contact
- $contact :Contact ID or Contact IDs array example :
Example
or
[email protected],[email protected],[email protected]
Max length : 300 char, almost 15 contacts
Send Location
- $address : Text under the location.
Supports two lines. To use two lines, use the \n symbol.
Max length : 300 char .
- $lat : Latitude
- $lng : longitude
Send Vcard
- $vcard : Text value vcard 3.0
Max length : 4096 char
Resend messages by status
- $status : unsent or expired
Resend message by ID
- $id : message id
Get Messages
get the messages that sent by api
- $page : pagination page number
- $limit : number of messages per request . max value : 100 .
- $status : Messages status [sent , queue , unsent]
- sent : get sent messages .
- queue : get queue messages .
- unsent : get unsent messages .
- invalid : get invalid messages .
- expired : get expired messages .
- all : get all messages .
- $sort :
- asc : sorted messages by ID from smallest to largest .
- desc : sorted messages by ID from largest to smallest .
- $id : filter messages by message ID .
- $referenceId : filter messages by your custom reference ID .
- $from : filter messages by WhatsApp sender number e.g [email protected] .
- $to : filter messages by recipient number e.g [email protected] or [email protected] .
- $ack : filter messages by message ack status [ pending , server , device , read , played ] .
Get Messages Statistics
Get Instance Status
Get Instance QR Image
Get Instance QR Code
Get Instance Info
Get connected phone informations : number , name , image etc..
Get Instance Settings
sendDelay : Delay in seconds between sending message, Default 1 second
webhook_url : Http or https URL for receiving notifications .
webhook_message_ack : on/off ack (message delivered and message viewed) notifications in webhooks.
webhook_message_received : on/off notifications in webhooks when message received .
webhook_message_create : on/off notifications in webhooks when message create .
webhook_message_download_media : on/off to get received document / media files.
Instance Takeover
Returns the active session if the device has connected to another instance of Web WhatsApp
Instance Logout
Logout from WhatsApp Web to get new QR code.
Instance Restart
Restart your instance.
Instance Settings Update
-
sendDelay : Delay in seconds between sending message .
-
webhook_url : Http or https URL for receiving notifications .
-
webhook_message_received : true/false notifications in webhooks when message received .
-
webhook_message_create : true/false notifications in webhooks when message create .
- webhook_message_ack : true/false ack (message delivered and message viewed) notifications in webhooks.
Get the chats list
get last message from chat conversation
- $chatId : chatID for contact or group e.g [email protected] or [email protected]
- $limit : number of messages per request .
max value : 1000 .
Get the contacts list
Get contact info
- $chatId : chatID for contact e.g [email protected]
Gets all blocked contacts
block contact from WhatsApp
- $chatId : chatID for contact e.g [email protected]
Unblock contact from WhatsApp
- $chatId : chatID for contact e.g [email protected]
Check if number is WhatsApp user
- $chatId : chatID for contact e.g [email protected]
Support
Use Issues to contact me