Enviar mensaje a un numero conectado a whatsapp.
$datos = [ 'telefono' => '7471086815', 'texto' => 'Hola Mundo!' ];
$json = json_encode($datos);
$url = 'http://mensajes.xyz/api/?token=API_KEY';
$opciones = stream_context_create(['http' => [
'method' => 'POST',
'header' => 'Content-type: application/json',
'content' => $json
]
]);
$resultado = file_get_contents($url, false, $opciones);
var request = require('request');
var url = 'http://mensajes.xyz/api/?token=API_KEY';
var datos = { telefono: '7471086815', texto: 'Hola Mundo!' };
request({
url: url,
method: "POST",
json: datos
});
var url = 'http://mensajes.xyz/api/?token=API_KEY';
var datos = { telefono: '7471086815', texto: 'Hola Mundo!' };
$.ajax(url, {
data : JSON.stringify(datos),
contentType : 'application/json',
type : 'POST'
});