Skip to content

aldinokemal/sdk-php-whatsapp-web-multidevice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SdkWhatsappWebMultiDevice

This API is used for sending whatsapp via API.

Device scoping:

  • Send X-Device-Id on all device-scoped REST calls.
  • WebSocket: connect to /ws?device_id=<id>.

Installation & Usage

Requirements

PHP 8.1 and later.

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/aldinokemal/sdk-php-whatsapp-web-multidevice.git"
    }
  ],
  "require": {
    "aldinokemal/sdk-php-whatsapp-web-multidevice": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/SdkWhatsappWebMultiDevice/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure HTTP basic authorization: basicAuth
$config = SdkWhatsappWebMultiDevice\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');


$apiInstance = new SdkWhatsappWebMultiDevice\Api\AppApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->appDevices();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AppApi->appDevices: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to http://localhost:3000

Class Method HTTP request Description
AppApi appDevices GET /app/devices Get list connected devices
AppApi appLogin GET /app/login Login to whatsapp server
AppApi appLoginWithCode GET /app/login-with-code Login with pairing code
AppApi appLogout GET /app/logout Remove database and logout
AppApi appReconnect GET /app/reconnect Reconnecting to whatsapp server
AppApi appStatus GET /app/status Get connection status
ChatApi archiveChat POST /chat/{chat_jid}/archive Archive or unarchive a chat
ChatApi getChatMessages GET /chat/{chat_jid}/messages Get messages from a specific chat
ChatApi labelChat POST /chat/{chat_jid}/label Label or unlabel a chat
ChatApi listChats GET /chats Get list of chats
ChatApi pinChat POST /chat/{chat_jid}/pin Pin or unpin a chat
ChatApi setDisappearingTimer POST /chat/{chat_jid}/disappearing Set disappearing messages timer
ChatwootApi chatwootSyncHistory POST /chatwoot/sync Sync message history to Chatwoot
ChatwootApi chatwootSyncStatus GET /chatwoot/sync/status Get Chatwoot sync progress
ChatwootApi chatwootWebhook POST /chatwoot/webhook Chatwoot webhook endpoint
DeviceApi addDevice POST /devices Add a new device
DeviceApi getDevice GET /devices/{device_id} Get device info
DeviceApi getDeviceStatus GET /devices/{device_id}/status Get device connection status
DeviceApi listDevices GET /devices List all devices
DeviceApi loginDevice GET /devices/{device_id}/login Login device with QR code
DeviceApi loginDeviceWithCode POST /devices/{device_id}/login/code Login device with pairing code
DeviceApi logoutDevice POST /devices/{device_id}/logout Logout device
DeviceApi reconnectDevice POST /devices/{device_id}/reconnect Reconnect device
DeviceApi removeDevice DELETE /devices/{device_id} Remove a device
GroupApi addParticipantToGroup POST /group/participants Adding more participants to group
GroupApi approveGroupParticipantRequest POST /group/participant-requests/approve Approve participant request to join group
GroupApi createGroup POST /group Create group and add participant
GroupApi demoteParticipantToMember POST /group/participants/demote Demote participants to member
GroupApi exportGroupParticipants GET /group/participants/export Export group participants as CSV
GroupApi getGroupInfoFromLink GET /group/info-from-link Get group information from invitation link
GroupApi getGroupParticipantRequests GET /group/participant-requests Get list of participant requests to join group
GroupApi getGroupParticipants GET /group/participants Get list of participants in a group
GroupApi groupInfo GET /group/info Group Info
GroupApi groupInviteLink GET /group/invite-link Group Invite Link
GroupApi joinGroupWithLink POST /group/join-with-link Join group with link
GroupApi leaveGroup POST /group/leave Leave group
GroupApi promoteParticipantToAdmin POST /group/participants/promote Promote participants to admin
GroupApi rejectGroupParticipantRequest POST /group/participant-requests/reject Reject participant request to join group
GroupApi removeParticipantFromGroup POST /group/participants/remove Remove participants from group
GroupApi setGroupAnnounce POST /group/announce Set group announce mode
GroupApi setGroupLocked POST /group/locked Set group locked status
GroupApi setGroupName POST /group/name Set group name
GroupApi setGroupPhoto POST /group/photo Set group photo
GroupApi setGroupTopic POST /group/topic Set group topic
MessageApi deleteMessage POST /message/{message_id}/delete Delete Message
MessageApi downloadMessageMedia GET /message/{message_id}/download Download media from message
MessageApi reactMessage POST /message/{message_id}/reaction Send reaction to message
MessageApi readMessage POST /message/{message_id}/read Mark as read message
MessageApi revokeMessage POST /message/{message_id}/revoke Revoke Message
MessageApi starMessage POST /message/{message_id}/star Star message
MessageApi unstarMessage POST /message/{message_id}/unstar Unstar message
MessageApi updateMessage POST /message/{message_id}/update Edit message by message ID before 15 minutes
NewsletterApi unfollowNewsletter POST /newsletter/unfollow Unfollow newsletter
SendApi sendAudio POST /send/audio Send Audio
SendApi sendChatPresence POST /send/chat-presence Send chat presence (typing indicator)
SendApi sendContact POST /send/contact Send Contact
SendApi sendFile POST /send/file Send File
SendApi sendImage POST /send/image Send Image
SendApi sendLink POST /send/link Send Link
SendApi sendLocation POST /send/location Send Location
SendApi sendMessage POST /send/message Send Message
SendApi sendPoll POST /send/poll Send Poll / Vote
SendApi sendPresence POST /send/presence Send presence status
SendApi sendSticker POST /send/sticker Send Sticker
SendApi sendVideo POST /send/video Send Video
UserApi userAvatar GET /user/avatar User Avatar
UserApi userBusinessProfile GET /user/business-profile Get Business Profile Information
UserApi userChangeAvatar POST /user/avatar User Change Avatar
UserApi userChangePushName POST /user/pushname User Change Push Name
UserApi userCheck GET /user/check Check if user is on WhatsApp
UserApi userInfo GET /user/info User Info
UserApi userMyContacts GET /user/my/contacts Get list of user contacts
UserApi userMyGroups GET /user/my/groups User My List Groups
UserApi userMyNewsletter GET /user/my/newsletters User My List Groups
UserApi userMyPrivacy GET /user/my/privacy User My Privacy Setting

Models

Authorization

Authentication schemes defined for the API:

basicAuth

  • Type: HTTP basic authentication

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 8.3.0
    • Generator version: 7.22.0-SNAPSHOT
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages