? Déverrouillez le potentiel de WhatsApp: une intégration puissante avec notre API non officielle!
? Notre API stable, bien que non officielle, permet une gestion efficace des groupes WhatsApp. Simplifiez l'administration et ajoutez ou supprimez facilement les membres.
Avec notre API, vous pouvez envoyer rapidement et facilement des messages de texte, d'audio, de vidéo et d'image. L'adaptation de votre entreprise doit vous adapter de manière approfondie.
? Restez à jour avec notre API, recevant des événements en temps réel lorsque de nouveaux messages sont reçus. Restez connecté et agile pour répondre aux interactions sur WhatsApp.
? Créez votre compte: visitez https://api-wa.me/sign-up pour créer votre compte et commencez à utiliser notre API aujourd'hui!
? Remise spéciale: utilisez le coupon GIT20 et obtenez 20% de réduction sur votre première instance!
composer require raphaelvserafim/client-php-api-wa-me
use Api Wame WhatsApp ;
include_once ' vendor/autoload.php ' ;
$ whatsapp = new WhatsApp (
[ " server " => " API server " ,
" key " => " Your Key Instance " ]
); $ whatsapp -> constructWebhook ();
$ whatsapp -> from -> remoteJid ; // number that sent message
$ whatsapp -> from -> messageType ; // video | text | audio| image | sticker | document| reaction | liveLocation |
$ whatsapp -> from -> msgId ;
$ whatsapp -> from -> pushName ;
$ whatsapp -> from -> text ; if ( $ whatsapp -> from -> messageType === " text " && $ whatsapp -> from -> text === " Hi " ) {
$ whatsapp -> sendText ( $ whatsapp -> from -> remoteJid , " Hello! " );
} echo $ whatsapp -> connect (); echo $ whatsapp -> inforInstance (); $ body = [
" allowWebhook " => 1 , // 1=true or 0=false
" webhookMessage " => "" ,
" webhookGroup " => "" ,
" webhookConnection " => "" ,
" webhookQrCode " => "" ,
" webhookMessageFromMe " => "" ,
" webhookHistory " => ""
];
echo $ whatsapp -> updateWebhook ( $ body ); echo $ whatsapp -> logout (); echo $ whatsapp -> listContacts (); echo $ whatsapp -> profilePic ( ' 556696852025 ' ); echo $ whatsapp -> updateProfileName ( ' Raphael Serafim ' ); $ url = '' ; // url image
echo $ whatsapp -> updateProfilePicture ( $ url ); $ to = ' 556696852025 ' ; // if it's a group, use full id ex: [email protected]
$ status = ' composing ' ; // unavailable | available | composing | recording | paused
echo $ whatsapp -> sendPresence ( $ to , $ status ); $ to = ' 556696852025 ' ; // if it's a group, use full id ex: [email protected]
$ text = ' Hi ' ;
echo $ whatsapp -> sendText ( $ to , $ text ); $ to = ' 556696852025 ' ; // if it's a group, use full id ex: [email protected]
$ url = '' ; // your MP3 or OGG audio URL
echo $ whatsapp -> sendAudio ( $ to , $ url ); $ to = ' 556696852025 ' ; // if it's a group, use full id ex: [email protected]
$ url = '' ;
$ caption = '' ;
echo $ whatsapp -> sendImage ( $ to , $ url ); $ to = ' 556696852025 ' ; // if it's a group, use full id ex: [email protected]
$ url = '' ;
$ caption = '' ;
echo $ whatsapp -> sendVideo ( $ to , $ url ); $ to = ' 556696852025 ' ; // if it's a group, use full id ex: [email protected]
$ url = '' ;
$ caption = '' ;
$ mimetype = ' application/pdf ' ; // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
$ fileName = '' ;
echo $ whatsapp -> sendDocument ( $ to , $ url , $ mimetype , $ fileName ); $ body = [
" to " => " 556696852025 " ,
" title " => " Are you enjoying ? " ,
" footer " => " choose an option " ,
" buttons " => [
[
" type " => " quick_reply " ,
" id " => " click_1 " ,
" text " => " Yes "
],
[
" type " => " cta_copy " ,
" copy_code " => " 000000000000 " ,
" text " => " Copy barcode "
],
[
" type " => " cta_url " ,
" url " => " https://api-wa.me " ,
" text " => " Access the website "
],
[
" type " => " send_location "
]
]
];
echo $ whatsapp -> sendButton ( $ body ); $ body = [
" to " => " 556696852025 " ,
" buttonText " => " Menu " ,
" text " => " string " ,
" title " => " Menu " ,
" description " => " Description " ,
" footer " => " footer " ,
" sections " => [
[
" title " => " Pizza " ,
" rows " => [
[
" title " => " Pizza 01 " ,
" description " => " Example pizza 01 " ,
" rowId " => " 1 "
]
]
]
]
];
echo $ whatsapp -> sendList ( $ body ); $ to = ' 556696852025 ' ; // if it's a group, use full id ex: [email protected]
$ name = ' CACHE SISTEMAS ' ;
$ number = ' +556696883327 ' ;
echo $ whatsapp -> sendContact ( $ to , $ name , $ number ); $ to = ' 556696852025 ' ; // if it's a group, use full id ex: [email protected]
$ lat = 37.7749 ;
$ lon = - 122.4194 ;
$ address = ' 123 Main St, San Francisco, CA ' ;
echo $ whatsapp -> sendLocation ( $ to , $ lat , $ lon , $ address ); $ to = ' 556696852025 ' ; // if it's a group, use full id ex: [email protected]
$ text = ' ? ' ;
$ msgId = '' ;
echo $ whatsapp -> sendReaction ( $ to , $ text , $ msgId ); echo $ whatsapp -> listGroup (); $ group_id = ' [email protected] ' ;
echo $ whatsapp -> inforGroup ( $ group_id ); $ group_id = ' [email protected] ' ;
echo $ whatsapp -> groupInviteCode ( $ group_id ); $ name = ' API PHP WhatsApp ' ;
$ participants = [ ' 556696852025 ' ];
echo $ whatsapp -> createGroup ( $ name , $ participants ); $ group_id = ' [email protected] ' ;
$ participants = [ ' 556696852025 ' ];
echo $ whatsapp -> addParticipantsGroup ( $ group_id , $ participants ); $ group_id = ' [email protected] ' ;
$ participants = [ ' 556696852025 ' ];
$ action = " promote " ; // demote
echo $ whatsapp -> promoteParticipantsGroup ( $ group_id , $ participants , $ action ); $ group_id = ' [email protected] ' ;
$ participants = [ ' 556696852025 ' ];
echo $ whatsapp -> removeParticipantsGroup ( $ group_id , $ participants ); $ group_id = ' [email protected] ' ;
echo $ whatsapp -> leaveGroup ( $ group_id );