mimamch / wa-gateway

Headless Multi Session Whatsapp Gateway API
MIT License
207 stars 108 forks source link

send bulk message #29

Open mrnoobnoobies opened 1 year ago

mrnoobnoobies commented 1 year ago

Hi, i need some example on how to use POST /send-bulk-message

how to use it using php curl? as i've succeed to be using POST /send-message, i need some example on how to use send bulk message

tq

mimamch commented 12 months ago

UP. I need PHP programmer here.

sikasep23 commented 8 months ago

there u go.

$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'http://localhost:5001/send-bulk-message', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 5000, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>'{ "session": "Session", "data":[ { "to":"628XXXXXXXX", "text": "text 1" }, { "to":"628XXXXXXXX", "text": "text 2" } ] }', CURLOPT_HTTPHEADER => array( 'Content-Type: application/json' ), ));

$response = curl_exec($curl);

curl_close($curl); echo $response;