ChatBot API Schnittstelle
Hinweis:
Möchten Sie unsere WhatsApp-Template API ausprobieren? Beginnen Sie mit der Verifizierung Ihrer Mobilnummer. Registrieren Sie sich in unserem WhatsApp-Nachrichtendienst. Sie bekommen anschließend eine Benachrichtigung über WhatsApp. Bitte bestätigen Sie diese, indem Sie auf "Newsletter-Start" klicken. Nach dieser Verifizierung können Sie unsere WhatsApp-API mit Ihrer eigenen Nummer testen.
<?php $botIdentifier = SUPPORT_BOT_IDENTIFIER; $clientId = REGISTERED_MOBILE_NUMBER; /* To check if mobile number registered */ $url = "https://bot.chatbot4you.de/restApi/cb4you/action/checkIfNumberRegistered?botIdentifier=".$botIdentifier; $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_RETURNTRANSFER => 1, CURLOPT_POST => 1, CURLOPT_URL => $url, CURLOPT_POSTFIELDS => [ "senderId" => $clientId, "currentHref" => YOUR_CURRENT_PAGE_URL ], CURLOPT_SSL_VERIFYPEER => false ]); $response = curl_exec($curl); // 1 for registered 0 for others curl_close($curl); /* To get registered whatsapp templates */ $url = "https://bot.chatbot4you.de/restApi/cb4you/action/getWhatsappTemplates?botIdentifier=".$botIdentifier; $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_RETURNTRANSFER => 1, CURLOPT_POST => 1, CURLOPT_URL => $url, CURLOPT_POSTFIELDS => [ "currentHref" => YOUR_CURRENT_PAGE_URL ], CURLOPT_SSL_VERIFYPEER => false ]); $response = curl_exec($curl); // templates list will be returned curl_close($curl); /* To send registered whatsapp templates */ $url = "https://bot.chatbot4you.de/restApi/cb4you/action/sendWhatsappTemplate?botIdentifier=?botIdentifier=".$botIdentifier; $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_RETURNTRANSFER => 1, CURLOPT_POST => 1, CURLOPT_URL => $url, CURLOPT_POSTFIELDS => [ /* For CONTENT UPDATE CHATBOT template type => 1, texts => array(VORNAME_VALUE,NACHNAME_VALUE, STATUS_VALUE), image => IMAGE_URL, urlSuffix => URL_SUFFIX_VALUE, mobile => $clientId /* For NEWSLETTER ANMELDUNG CHATBOT template */ type => 3, urlSuffix => URL_SUFFIX_VALUE, mobile => $clientId /* For NEWS-UPDATE template */ type => 4, texts => array(VORNAME, NACHNAME, FREITEXT1, FREITEXT2), mobile => $clientId ], CURLOPT_SSL_VERIFYPEER => false ]); $response = curl_exec($curl); // templates list will be returned curl_close($curl); ?>