Jump to content
Bicrypto v4.1.3 + All Plugins ×

Recommended Posts

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

Link to comment
Share on other sites

11 hours ago, Gerry 施顺杰 Sidharta said:

Ow udah coba kemarin tapi tetap gak bsa , masalahnya ane pake cloud panel , dia selalu minta untuk di arahkan ke https, mungkin mau di edit di vhost nya ya?

Tidak bisa karena Node.js dalam script ini menggunakan HTTP, akan sulit untuk mengubah Node.js agar berjalan di HTTPS.

Solusi terbaik adalah menyelesaikan masalah hosting cloud agar kamu bisa menggunakan HTTP.

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