Jump to content

Recommended Posts

@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

@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 😄

@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
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

On 6/2/2024 at 6:38 PM, bloserda said:

@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"
          }
        

why is the status Error?

Screenshot 2024-06-08 134321.png

Screenshot 2024-06-08 134442.png

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...