Esta documentación proporcionará instrucciones sobre cómo integrar rápidamente los servicios de SMS en varias soluciones utilizando la API HTTP.
Nuestra API se basa en estándares REST. Para interactuar con nuestra API, se puede usar cualquier cliente HTTP en cualquier lenguaje de programación.
La documentación es intuitiva y está escrita con los desarrolladores en mente.
Para utilizar nuestra API, necesitará información de identificación.
Estos no solo se utilizan para la API, sino también para otros servicios, como su área de clientes.
Aunque puede utilizar el protocolo HTTP, le recomendamos que envíe todas sus solicitudes a la API API de SMS a través de HTTPS strong> para que el tráfico esté encriptado y se garantice la confidencialidad.
URL de base :
https://vavasms.com/api
Usamos formateo de números E.164 que está estandarizado internacionalmente. Los números de teléfono generalmente van precedidos de un signo (más), seguido del código del país, el código de red y el número de suscriptor.
Indicativo | Número de teléfono |
---|---|
225 | 09000001 |
Nous n'envoyons des méssages qu'à des numéro de téléphone valide (numéros), escrito en formato internacional par ex. 22509000001, 22377000010
POST : https://vavasms.com/api/v1/check/balance
Nombre | Tipo | Descripción |
---|---|---|
username | string | el correo electrónico de tu cuenta |
password | string | la contraseña de tu cuenta |
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://vavasms.com/api/v1/check/balance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "username=your_email&password=your_password",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/x-www-form-urlencoded"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "username=your_email&password=your_password");
Request request = new Request.Builder()
.url("https://vavasms.com/api/v1/check/balance")
.method("POST", body)
.addHeader("Content-Type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
var settings = {
"url": "https://vavasms.com/api/v1/check/balance",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
"data": {
"username": "your_email",
"password": "your_password"
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var request = require("request");
var options = { method: 'POST',
url: 'https://vavasms.com/api/v1/check/balance',
headers:
{'cache-control': 'no-cache',
'Host': 'vavasms.com',
'Content-Type': 'application/x-www-form-urlencoded'},
form: { username: 'your_email', password: 'your_password' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
import http.client
import mimetypes
conn = http.client.HTTPSConnection("vavasms.com")
payload = 'username=your_email&password=your_password'
headers = {
'Content-Type': 'application/x-www-form-urlencoded'
}
conn.request("POST", "/api/v1/check/balance", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var client = new RestClient("https://vavasms.com/api/v1/check/balance");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("username", "your_email");
request.AddParameter("password", "your_password");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
{
"code": 0,
"message": "OPERATION_SUCCES",
"data": {
"amount": 25540,
"currency": "XOF"
}
}
{
"code": 901,
"message": "INVALID_CREDENTIALS",
"description": "Identifiant de connexion incorrect",
"data": []
}
NB: El saldo está en XOF (XOF)
De forma predeterminada, su nombre de usuario es su SENDER_ID strong>, pero puede solicitar más SENDER_ID strong> en su cuenta.
Nombre | Tipo | Descripción |
---|---|---|
username | string | el correo electrónico de tu cuenta |
password | string | la contraseña de tu cuenta |
sender_id | string | La longitud del identificador alfanumérico del remitente debe tener entre 3 y 11 caracteres (ejemplo: <code> CompanyName </ code>). |
phone | string |
Los números de destino del mensaje. Separado por comas si desea enviar a múltiples números de teléfono
Ejemplo de envío a un contacto : 22509000001 Ejemplo de envío a múltiples contactos: 22509000001,22509000002 |
message | string | Texto del mensaje que se enviará. |
La longitud máxima de un mensaje es de 160 caracteres para el estándar GSM7 o 70 caracteres para mensajes codificados Unicode. Si envía un texto que excede el número máximo de caracteres admitidos, el mensaje enviado se segmentará y facturará en consecuencia. Un SMS largo que consta de dos mensajes SMS cuenta como dos mensajes SMS.
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://vavasms.com/api/v1/text/single",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "username=your_email&password=your_password&sender_id=your_sender_id&phone=your_receiver_phone_number&message=your_message_here",
CURLOPT_HTTPHEADER => array(
"Accept: */*",
"Content-Type: application/x-www-form-urlencoded",
"Host: vavasms.com"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "username=your_email&password=your_password&sender_id=your_sender_id&phone=your_receiver_phone_number&message=your_message_here");
Request request = new Request.Builder()
.url("https://vavasms.com/api/v1/text/single")
.post(body)
.addHeader("Content-Type", "application/x-www-form-urlencoded")
.addHeader("Accept", "*/*")
.addHeader("Host", "vavasms.com")
.build();
Response response = client.newCall(request).execute();
var settings = {
"async": true,
"crossDomain": true,
"url": "https://vavasms.com/api/v1/text/single",
"method": "POST",
"headers": {
"Content-Type": "application/x-www-form-urlencoded",
"Accept": "*/*",
"Host": "vavasms.com"
},
"data": {
"username": "your_email",
"password": "your_password",
"sender_id": "your_sender_id",
"phone": "your_receiver_phone_number",
"message": "your_message_here"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var request = require("request");
var options = { method: 'POST',
url: 'https://vavasms.com/api/v1/text/single',
headers:
{ 'Host': 'vavasms.com',
'Accept': '*/*',
'Content-Type': 'application/x-www-form-urlencoded' },
form:
{ username: 'your_email',
password: 'your_password',
sender_id: 'your_sender_id',
phone: 'your_receiver_phone_number',
message: 'your_message_here' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
import http.client
conn = http.client.HTTPConnection("vavasms.com")
payload = "username=your_email&password=your_password&sender_id=your_sender_id&phone=your_receiver_phone_number&message=your_message_here"
headers = {
'Content-Type': "application/x-www-form-urlencoded",
'Accept': "*/*",
'Host': "vavasms.com"
}
conn.request("POST", "api,v1,text,single", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
{
"code": 0,
"message": "OPERATION_SUCCES",
"data": {
"lot_id": "LOT-20190623-1217676",
"description": "Message envoyé avec succès",
"message_id": [
"SM-20190623-1217879"
]
}
}
{
"code": "901",
"status": "INVALID_CREDENTIALS",
"description": "Identifiant de connexion incorrect",
}
{
"code": "902",
"status": "INVALID_SENDER_ID",
"description": "Le sender_id n’existe pas",
}
{
"code": "903",
"status": "INVALID_PHONE_NUMBER",
"description": "Le format du numéro de téléphone est invalide",
}
Nombre | Tipo | Descripción |
---|---|---|
username | string | el correo electrónico de tu cuenta |
password | string | la contraseña de tu cuenta |
message_id | string | El identificador de mensaje Ex : RMA029VA222991919 |
lot_id | string | Opcional | El identificador de lote Ex : RMA029VA222991919 |
{
"code": 0,
"message": "OPERATION_SUCCES",
"data": [
{
"lot_id": "LOT-20190617-1445425",
"message_id": "SM-20190617-1445914",
"status": "sent",
"description": "Envoyé"
}
]
}
{
"code": "901",
"status": "INVALID_CREDENTIALS",
"description": "Identifiant de connexion incorrect",
}
{
"code": "709",
"message": "EXECUTION_ERROR",
"description": "Aucun envoi existe pour ce ID",
"data": []
}
El enlace de notificación es el que llama la plataforma para notificarle la recepción de un SMS y su contenido.
Esta URL debe estar disponible para alojar solicitudes HTTP de tipo POST.
Debe configurar su URL de notificación en su back office
Nombre | Tipo | Descripción |
---|---|---|
message_id | string | el identificador del mensaje |
form | string | El remitente del SMS |
content | string | el contenido del mensaje |
sms_date | string | la fecha de recepción del SMS |
Nota : Preste atención al valor de « message_id » para evitar el procesamiento duplicado
Nombre | Tipo | Descripción |
---|---|---|
username | string | el correo electrónico de tu cuenta |
password | string | la contraseña de tu cuenta |
sender_id | string | La longueur du sender_id alphanumérique doit être comprise entre 3 et 11 caractères (exemple : CompanyName ).
|
otp_length | integer | La longueur de l'OTP à generer. doit être comprise entre 4 et 9 par defaut : 4 .
|
otp_expiry | integer |
La durée de l'OTP à verifier en minute. par défaut : 60 |
phone | string | Le numéro de destination du message qui reçoit le code OTP. Exemple d'envoi à un contact : 22509000001 |
message | string | Texte du message qui sera envoyé. le message doit comporter la balise ##OTP## Par defaut, le message est : Votre code OTP est : ##OTP## |
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://vavasms.com/api/v1/otp/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "username=your_email&password=your_password&sender_id=your_sender_id&phone=your_receiver_phone_number",
CURLOPT_HTTPHEADER => array(
"Accept: */*",
"Content-Type: application/x-www-form-urlencoded",
"Host: vavasms.com"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "username=your_email&password=your_password&sender_id=your_sender_id&phone=your_receiver_phone_number");
Request request = new Request.Builder()
.url("https://vavasms.com/api/v1/otp/send")
.post(body)
.addHeader("Content-Type", "application/x-www-form-urlencoded")
.addHeader("Accept", "*/*")
.addHeader("Host", "vavasms.com")
.build();
Response response = client.newCall(request).execute();
var settings = {
"async": true,
"crossDomain": true,
"url": "https://vavasms.com/api/v1/otp/send",
"method": "POST",
"headers": {
"Content-Type": "application/x-www-form-urlencoded",
"Accept": "*/*",
"Host": "vavasms.com"
},
"data": {
"username": "your_email",
"password": "your_password",
"sender_id": "your_sender_id",
"phone": "your_receiver_phone_number"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var request = require("request");
var options = { method: 'POST',
url: 'https://vavasms.com/api/v1/otp/send',
headers:
{ 'Host': 'vavasms.com',
'Accept': '*/*',
'Content-Type': 'application/x-www-form-urlencoded' },
form:
{ username: 'your_email',
password: 'your_password',
sender_id: 'your_sender_id',
phone: 'your_receiver_phone_number' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
var request = require("request");
var options = { method: 'POST',
url: 'https://vavasms.com/api/v1/otp/send',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
form:
{ username: 'your_email',
password: 'your_password',
sender_id: 'your_sender_id',
phone: 'your_receiver_phone_number' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
{
"code": 0,
"message": "OPERATION_SUCCES",
"data": {
"message_id": "OTP-20190621-2234509",
"description": "OTP envoyé avec succès"
}
}
{
"code": "901",
"status": "INVALID_CREDENTIALS",
"description": "Identifiant de connexion incorrect",
}
{
"code": "902",
"status": "INVALID_SENDER_ID",
"description": "Le sender_id n’existe pas",
}
{
"code": "903",
"status": "INVALID_PHONE_NUMBER",
"description": "Le format du numéro de téléphone est invalide",
}
Nombre | Tipo | Descripción |
---|---|---|
username | string | el correo electrónico de tu cuenta |
password | string | la contraseña de tu cuenta |
otp | integer | Le code OTP à verifier. |
phone | string | Le numéro de téléphone qui a reçu le code OTP. Exemple d'envoi à un contact : 22509000001 |
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://vavasms.com/api/v1/otp/verify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "username=your_email&password=your_password&sender_id=your_sender_id&phone=your_receiver_phone_number&otp=otp_received",
CURLOPT_HTTPHEADER => array(
"Accept: */*",
"Content-Type: application/x-www-form-urlencoded",
"Host: vavasms.com"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "username=your_email&password=your_password&sender_id=your_sender_id&phone=your_receiver_phone_number&otp=otp_received");
Request request = new Request.Builder()
.url("https://vavasms.com/api/v1/otp/verify")
.post(body)
.addHeader("Content-Type", "application/x-www-form-urlencoded")
.addHeader("Accept", "*/*")
.addHeader("Host", "vavasms.com")
.build();
Response response = client.newCall(request).execute();
var settings = {
"async": true,
"crossDomain": true,
"url": "https://vavasms.com/api/v1/otp/verify",
"method": "POST",
"headers": {
"Content-Type": "application/x-www-form-urlencoded",
"Accept": "*/*",
"Host": "vavasms.com"
},
"data": {
"username": "your_email",
"password": "your_password",
"sender_id": "your_sender_id",
"phone": "your_receiver_phone_number",
"otp": "otp_received",
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var request = require("request");
var options = { method: 'POST',
url: 'https://vavasms.com/api/v1/otp/verify',
headers:
{ 'Host': 'vavasms.com',
'Accept': '*/*',
'Content-Type': 'application/x-www-form-urlencoded' },
form:
{ username: 'your_email',
password: 'your_password',
sender_id: 'your_sender_id',
otp: 'otp_received',
phone: 'your_receiver_phone_number' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
var request = require("request");
var options = { method: 'POST',
url: 'https://vavasms.com/api/v1/otp/verify',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
form:
{ username: 'your_email',
password: 'your_password',
sender_id: 'your_sender_id',
otp: 'otp_received',
phone: 'your_receiver_phone_number' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
{
"code": 0,
"message": "OPERATION_SUCCES",
"data": {
"message_id": "OTP-20190621-2250698",
"status": "success"
}
}
{
"code": "901",
"status": "INVALID_CREDENTIALS",
"description": "Identifiant de connexion incorrect",
}
{
"code": "902",
"status": "INVALID_SENDER_ID",
"description": "Le sender_id n’existe pas",
}
{
"code": 913,
"message": "INVALID_OTP",
"description": "vavasms.INVALID_OTP",
"data": []
}