Anda di halaman 1dari 3

Zenziva

SMS Reguler - HTTP API V1.0

(Kirim SMS via HTTP API)


Untuk mengirim SMS ke satu penerima
Perintah:
https://reguler.zenziva.net/apps/smsapi.php?userkey=xxx&passke
y=xxx&nohp=xxx&pesan=xxx

Contoh:

https://reguler.zenziva.net/apps/smsapi.php?userkey=xxxxxx&pas
skey=xxxxxx&nohp=081234567890&pesan=test kirim sms dengan
zenziva api

PARAMETER DESKRIPSI
userkey Userkey anda
passkey Passkey anda
nohp Nomor tujuan
pesan Isi pesan

Respon dari perintah di atas dalam format XML.

Contoh respon:
<response>
<message>
<to>081234567890</to>
<status>0</status>
<text>Success</text>
<balance>9999</balance>
</message>
</response>

Status Code
status Deskiripsi
Success
0
SMS telah berhasil disubmit ke server.
1 Nomor tujuan tidak valid.

5 Userkey / Passkey salah.

6 Konten SMS rejected.


Pengiriman SMS berulang-ulang ke satu nomor
89
dalam satu waktu.
99 Credit tidak mencukupi.
Contoh script php:

<?php

$userkey = "xxxxxx";
$passkey = "xxxxxx";
$telepon = "081234567890";
$message = "Terima Kasih, pendaftaran atas nama $nama telah.";
$url = "https://reguler.zenziva.net/apps/smsapi.php";

$curlHandle = curl_init();
curl_setopt($curlHandle, CURLOPT_URL, $url);
curl_setopt($curlHandle, CURLOPT_POSTFIELDS,
'userkey='.$userkey.'&passkey='.$passkey.'&nohp='.$telepon.'&pesan='.urlenc
ode($message));
curl_setopt($curlHandle, CURLOPT_HEADER, 0);
curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curlHandle, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($curlHandle, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curlHandle, CURLOPT_TIMEOUT,30);
curl_setopt($curlHandle, CURLOPT_POST, 1);
$results = curl_exec($curlHandle);
curl_close($curlHandle);

$XMLdata = new SimpleXMLElement($results);


$status = $XMLdata->message[0]->text;
echo $status;

?>

Cek Credit

Perintah:
https://reguler.zenziva.net/apps/smsapibalance.php?userkey=xxx
&passkey=xxx

Contoh:

https://reguler.zenziva.net/apps/smsapibalance.php?userkey=xxx
xxx&passkey=xxxxxx

Respone:

<response>
<message>
<value>9999</value>
<text>20 Januari 2020</text>
</message>
</response>