Download the PHP package hexxondiv/whatsapp without Composer
On this page you can find all versions of the php package hexxondiv/whatsapp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hexxondiv/whatsapp
More information about hexxondiv/whatsapp
Files in hexxondiv/whatsapp
Package whatsapp
Short Description Lightweight PHP library for WhatsApp API to send the WhatsApp messages in PHP using ultramsg.com API
License MIT
Informations about the package whatsapp
Ultramsg.com WhatsApp API PHP SDK
Lightweight PHP library for WhatsApp API to send the whatsappp messages in PHP provided by hexxondiv
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.
The $referenceId is optional. You can do without it, and the system will still return you a message id.
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
Send Image
- $caption : image Caption, UTF-8 or UTF-16 string with emoji .
- $image : HTTP link image or base64-encoded file with mime data
Supported extensions ( jpg , jpeg , gif , png , svg , webp , bmp ) .
Max file size : 64MB .
example images links :
-
jpg : https://file-example.s3-accelerate.amazonaws.com/images/test.jpg
-
jpeg : https://file-example.s3-accelerate.amazonaws.com/images/test.jpeg
-
png : https://file-example.s3-accelerate.amazonaws.com/images/test.png
-
svg : https://file-example.s3-accelerate.amazonaws.com/images/test.svg
-
gif : https://file-example.s3-accelerate.amazonaws.com/images/test.gif
-
bmp : https://file-example.s3-accelerate.amazonaws.com/images/test.bmp
- webp : https://file-example.s3-accelerate.amazonaws.com/images/test.webp
Send Document
- $filename : File name, for example 1.jpg or Hello.pdf
- $document : HTTP link file or base64-encoded file with mime data
Supported most extensions like ( zip , xlsx , csv , txt , pptx , docx ....etc ) .
Max file size : 64MB .
Send Audio
- $audio : HTTP link audio or base64-encoded audio with mime data
Supported extensions ( mp3 , aac , ogg ) .
Max file size : 64MB .
Send Voice
- $audio : HTTP link audio ogg-file with opus codec or base64 ogg-file in opus codec
Send Video
- $video : HTTP link video or base64-encoded video with mime data
Supported extensions ( mp4 , 3gp , mov ) .
Max file size : 64MB .
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
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 .
- all : get all messages .
- $sort :
- asc : sorted messages by ID from smallest to largest .
- desc : sorted messages by ID from largest to smallest .
Get Messages Statistics
Get Instance Status
Get Instance QR Image
Get Instance QR Code
Get Instance Screenshot
or base64
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 .
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.
Support
Use Issues to contact me
Please note that this is a mere fork of the original library by ultramsg.com
I merely included the referenceId part, because I needed it to distinguish multiple businesses I serve from one instance.