var axios = require('axios');
var FormData = require('form-data');
var data = new FormData();
telefono = '584120001112'; // Formato Internacional sin +
mensaje = 'Mensaje de prueba'; // Mensaje
token = 'TOKEN'; // Tu Token de seguridad
account_id = '5'; // Account ID
data.append('phone', telefono);
data.append('message', mensaje);
var config = {
method: 'post',
url: 'https://wa.redmasiva.com/api/send?token=' + token + '&account_id=' + account_id,
headers: {
...data.getHeaders()
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
require "uri"
require "net/http"
telefono = '584120001112'; # Formato Internacional sin +
mensaje = 'Mensaje de prueba'; # Mensaje
token = 'TOKEN'; # Tu Token de seguridad
account_id = '5'; # Account ID
url = URI('https://wa.redmasiva.com/api/send?token=' + token + '&account_id=' + account_id)
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
form_data = [['phone', telefono],['message', mensaje]]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests
telefono = '584120001112'; # Formato Internacional sin +
mensaje = 'Mensaje de prueba'; # Mensaje
token = 'TOKEN'; # Tu Token de seguridad
account_id = '5'; # Account ID
url = 'https://wa.redmasiva.com/api/send?token=' + token + '&account_id=' + account_id,
payload = {'phone': '584127776633',
'message': 'Prueba'}
files=[
]
headers = {})
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
CURL *curl
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt (curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt (curl, CURLOPT_URL, "https://wa.redmasiva.com/api/send?token=TOKEN&account_id=ACCOUNT_ID");
curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt (curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
curl_easy_setopt (curl, CURLOPT_HTTPHEADER, headers);
curl_mime *mime;
curl_mimepart *part;
mime curl_mime_init(curl);
part curl_mime_addpart(mime);
curl_mime_name(part, "phone");
curl_mime_data(part, "584127776633", CURL_ZERO_TERMINATED);
part curl_mime_addpart(mime);
curl_mime_name(part, "message");
curl_mime_data(part, "Prueba", CURL_ZERO_TERMINATED);
curl_easy_setopt(curl, CURLOPT_MIMEPOST, mime);
res = curl_easy_perform(curl)
curl_mime_free(mime);
}
curl_easy_cleanup(curl);