PHP

Create New Message

Text Message Only

$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://app.saungwa.com/api/create-message',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array(
'appkey' => 'e98095ab-363d-47a4-b3b6-af99d68ef2b8',
'authkey' => 'jH7UfjEsjiw86eF7fTjZuQs62ZIwEqtHL4qjCR6mY6sE36fmyT',
'to' => 'RECEIVER_NUMBER',
'message' => 'Example message',
'sandbox' => 'false'
),
));

$response = curl_exec($curl);

curl_close($curl);


Pesan Teks dengan file



$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://app.saungwa.com/api/create-message',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array(
  'appkey' => 'e98095ab-363d-47a4-b3b6-af99d68ef2b8',
  'authkey' => 'jH7UfjEsjiw86eF7fTjZuQs62ZIwEqtHL4qjCR6mY6sE36fmyT',
  'to' => 'RECEIVER_NUMBER',
  'message' => 'Example message',
  'file' => 'https://www.africau.edu/images/default/sample.pdf',
  'sandbox' => 'false'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Template Message Only


$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://app.wapanels.com/api/create-message',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array(
  'appkey' => 'e98095ab-363d-47a4-b3b6-af99d68ef2b8',
  'authkey' => 'jH7UfjEsjiw86eF7fTjZuQs62ZIwEqtHL4qjCR6mY6sE36fmyT',
  'to' => 'RECEIVER_NUMBER',
  'template_id' => 'TEMPLATE_ID',
  'variables' => array(
    '{variableKey1}' => 'Jhone',
    '{variableKey2}' => 'replaceable value'
   )
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Successful Json Callback

 {
    "message_status": "Success",
    "data": {
        "from": "SENDER_NUMBER",
        "to": "RECEIVER_NUMBER",
        "status_code": 200
    }
}      
S/N Value Type Required Description
1. appkey string Yes Used to authorize a transaction for the app
2. authkey string Yes Used to authorize a transaction for the is valid user
3. to number Yes Who will receive the message the Whatsapp number should be full number with country code
4. template_id string No Used to authorize a transaction for the template
5. message string No The transactional message max:1000 words
6. file string No file extension type should be in jpg,jpeg,png,webp,pdf,docx,xlsx,csv,txt
7. variables Array No the first value you list replaces the {1} variable in the template message and the second value you list replaces the {2} variable

CURL


Text Message Only

curl --location --request POST 'https://app.saungwa.com/api/create-message' \
--form 'appkey="e98095ab-363d-47a4-b3b6-af99d68ef2b8"' \
--form 'authkey="jH7UfjEsjiw86eF7fTjZuQs62ZIwEqtHL4qjCR6mY6sE36fmyT"' \
--form 'to="RECEIVER_NUMBER"' \
--form 'message="Example message"' \

Text Message with file


curl --location --request POST 'https://app.saungwa.com/api/create-message' \
--form 'appkey="e98095ab-363d-47a4-b3b6-af99d68ef2b8"' \
--form 'authkey="jH7UfjEsjiw86eF7fTjZuQs62ZIwEqtHL4qjCR6mY6sE36fmyT"' \
--form 'to="RECEIVER_NUMBER"' \
--form 'message="Example message"' \
--form 'file="https://www.africau.edu/images/default/sample.pdf"'


  

Template Only

curl --location --request POST 'https://app.saungwa.com/api/create-message' \
--form 'appkey="e98095ab-363d-47a4-b3b6-af99d68ef2b8"' \
--form 'authkey="jH7UfjEsjiw86eF7fTjZuQs62ZIwEqtHL4qjCR6mY6sE36fmyT"' \
--form 'to="RECEIVER_NUMBER"' \
--form 'template_id="TEMPLATE_ID"' \
--form 'variables[{variableKey1}]="jhone"' \
--form 'variables[{variableKey2}]="replaceable value"'

Successful Json Callback

 {
    "message_status": "Success",
    "data": {
        "from": "SENDER_NUMBER",
        "to": "RECEIVER_NUMBER",
        "status_code": 200
    }
}
  
S/N Value Type Required Description
1. appkey string Yes Used to authorize a transaction for the app
2. authkey string Yes Used to authorize a transaction for the is valid user
3. to number Yes Who will receive the message the Whatsapp number should be full number with country code
4. template_id string No Used to authorize a transaction for the template
5. message string No The transactional message max:1000 words
6. file string No file extension type should be in jpg,jpeg,png,webp,pdf,docx,xlsx,csv,txt
7. variables Array No the first value you list replaces the {1} variable in the template message and the second value you list replaces the {2} variable

Read More
Success Rate

These entrepreneurs feel
bright and full of hope.

Delightful unreserved impossible few estimating men favourable see entreaties. She propriety immediate was improving. He or entrance humoured likewise moderate. Much nor game son say feel. Fat make met can must form into gate. Me we offending prevailed discovery.

Read More