Skip to content

morettic2015/whatsApp-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP library for WhatsApp api

Latest Version Total Downloads

Light PHP library for interact with WhatsApp api.

Installing

The recommended way to install is through Composer.

# Install Composer
curl -sS https://getcomposer.org/installer | php

Next, run the Composer command to install the latest stable version:

php composer.phar require chatapi/whatsApp

After installing, you need to require Composer's autoloader:

require 'vendor/autoload.php';

You can then later update library using composer:

composer.phar update

Usage

Create client instance

$client = Client::getInstance([
   'url' => 'your_url',
   'token' => 'your_token'
]);

Send message

$client->sendMessage([
   'phone' => '78005553535',
   'body' => 'Hi there!'
]);

Send file

$data = $client->sendFile([
   'phone' => '78005553535', 
   'body' => 'some_file',      // file in base64
   'filename' => 'sample.jpg'
]);

Create group

$client->createGroup(
   'New chat', ['78005553535'], 'First message'
);

Get list of all incoming messages

$data = $client->getMessages();

Get not sent messages queue

$data = $client->getMessagesQueue();

Clear not sent messages queue

$data = $client->clearMessagesQueue();

Get account status

$data = $client->getStatus();

Get QR-code

$data = $client->getQrCode();

Set webhook

$data = $client->setWebHook('http://<some_url>');

Get webhook

$data = $client->getWebHook();

Reboot application

$data = $client->reboot();

Logout

$data = $client->logout();

About

PHP library for interract with WhatsApp api

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages