Jump to content
Bicrypto v4.1.3 + All Plugins ×

Recommended Posts

Si necesitan enviar un mensaje a Whatsapp desde php y sin hacerlo desde la plataforma, pueden usar esto desde cualquier web externa, solo cambien los valores necesarios

 

<?php
// URL de destino
$url = 'https://www.example.com/endpoint'; // URL a la que deseas enviar la solicitud
// Datos a enviar (si es necesario)
$postData = http_build_query(array(
    'key1' => 'value1',
    'key2' => 'value2'
));
// Opciones de contexto para la solicitud (ignorar resultados y errores)
$contextOptions = array('http' => array(
    'method' => 'POST',
    'header' => "Content-Type: application/x-www-form-urlencoded\r\n"
                . "Content-Length: " . strlen($postData) . "\r\n",
    'content' => $postData,
    'ignore_errors' => true // Ignorar errores en la respuesta
));
$context = stream_context_create($contextOptions);
// Realizar la solicitud sin mostrar resultados ni datos
$response = file_get_contents($url, false, $context);
if ($response === false) {
    echo "La solicitud no se pudo completar.";
} else {
    echo "Solicitud enviada correctamente sin mostrar resultados ni datos.";
}
?>

 

Link to comment
Share on other sites

On 5/25/2024 at 2:40 PM, ashoksingh shekhawat said:

also getting this error

Screenshot_12.png

The problem from nodjs

You need to install nodjs 16.2

Only this version is stable .. so after install this version you install (pm2):

npm install pm2@latest -g
# or
yarn global add pm2

# after install pm2 you run this command and change the info to your website:
 
cd /home/username/public_html/whatsappscript
pm2 start server.js

 

Link to comment
Share on other sites

1 hour ago, pisang masbro said:

hELP vendor/symfony/string/Resources/functions.php on line 34

I don't exactly know what your problem is. Can you clarify more? Is it when sending a message, opening the website, or something else?

It seems your current issue is that you updated the package.json via npm, which you should never do because the script is compatible with the specific vendors listed within it.

  • Like 1
Link to comment
Share on other sites

On 5/29/2024 at 4:03 AM, Magd Almuntaser said:

The problem from nodjs

You need to install nodjs 16.2

Only this version is stable .. so after install this version you install (pm2):

npm install pm2@latest -g
# or
yarn global add pm2

# after install pm2 you run this command and change the info to your website:
 
cd /home/username/public_html/whatsappscript
pm2 start server.js

Ini dimenu apa?

Dimenu apa ya ini?

Link to comment
Share on other sites

@Gusik Prasetyo 

Example how to Blast / Bulk message (Different message per number)
type blast: Text (yourhost.com/send-message)

1. Create New spreadsheet :
Column : ColA | ColB | ColC
Exp. Col Name : Destination | Message | Status
*Note Destination: 
- use numberphone  send to personal (628xxxxxxxx)
- use JID send to group (blablabla@g.us) (how to get JID? click Fetch From Selected Device on menu mpwa Phonebook)

2. Create send button:
a. Click Insert -> Drawer (textboxt, SEND) -> Save & Close
b. On shape, right click 3 dot on left choose Assign script type: sendAll

3. Create Google Apps Script:
a. Still on your spreadsheet, click menu Extension -> Apps Script
b. Copy paste sript below:

// Start Here
var url = "http://yourhost/send-message";
var apiKey = "your api_key";
var sender = "your number sender";

function blastWa(number, message) {
  var data = {
    'api_key': apiKey,
    'sender': sender,
    'number': number,
    'message': message
  };
  var options = {
    "method": "POST",
    "contentType": "application/json",
    "payload" : JSON.stringify(data),
  };
  UrlFetchApp.fetch(url, options);
}

function sendFromSheets(){
  var sheet = SpreadsheetApp.getActiveSheet();
  var startRow = 2;
  var numRows = sheet.getLastRow() - 1;
  var dataRange = sheet.getRange(startRow, 1, numRows, 2);
  var data = dataRange.getValues();
  
  for (var i = 0; i < data.length; i++){
    var row = data[i];
    var status;
    try {
      var response_data = blastWa(row[0], row[1]);
      status = "Success";
      } 
      catch(err) {
        Logger.log(err);
        status = "Error";
        }
    sheet.getRange(startRow + i, 3).setValue(status);
    Utilities.sleep(10000); //example time delay
  }
}

function sendAll(){
  sendFromSheets();
}
                                  
//End Here

c. Save (give all permission needed).
4. Running on spreadsheet click on button SEND you have been create.

 

How if wanna blast/bulk message different media per number? 

yourhost.com/send-media, change method post (API Docs) 

 

          {
            "api_key": "1234567890",
            "sender": "62888xxxx",
            "number": "62888xxxx",
            "media_type": "image",
            "caption": "Hello World",
            "url": "https://example.com/image.jpg"
          }
        
  • Like 1
Link to comment
Share on other sites

@mantapin jika pakai api, coba cek di youtube kalau tidak salah produk milik whacenter atau kl mau gampang autoreply integrasi dgn gsheet pakai apk whatsauto di playstore (gratis), tinggal masukkan link google sheet di setting apknya selesai (saya pernah pakai stabil),  tapi jika handphone/sinyal mati, bot mati juga 😄

Link to comment
Share on other sites

@Gusik Prasetyo

buat menagkap pesan dulu

function doPost(e) {
  // Membaca pesan
  let conten = e.postData.contents;
  let json = JSON.parse(conten);
  let wa = json['from'];
  let senderMessage = json['message'];
  let pesan = senderMessage.toLowerCase();
  let image = json['bufferImage'];
 
if (pesan == 'menu') {
    let msg = "Silahkan pilih menu";
    kirimpesan(wa, msg);
  }
}
 
function kirimpesan(wa, msg) {
  var APIKey = "your api key"
  var url = "https://wa.trioputra.my.id/send-message";
  var payload = {
    'api_key': APIKey,
    'sender': '6281559554xxx',
    "number": wa,
    'message': msg,
   
 
  };
  var response = UrlFetchApp.fetch(url, {
    "method": "post",
    "headers": {
      "apikey": APIKey
    },
    "payload": payload
  });
  Logger.log(response.getContentText());
}
 
deploy lalu copy url web dan paste di webhook
  • Like 2
Link to comment
Share on other sites

28 minutes ago, Gerry 施顺杰 Sidharta said:

halo semua master disini tolong bantu dong.. saya coba install di vps ubuntu 22.04 dan semua sdh jalan node . juga sdh aman Server run and listening port: 3100 tapi kok masih waiting node server ya apakah ada yang saya masih kurang atau salah langkah ya ? image.thumb.png.895005d55a53701bf654e692b280f49d.png

Anda harus menggunakan tautan situs http, bukan https

========

You should use http in link, not https

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...