<?php
$token = 'EAAEdR4iWMnQBO2Ki6kSjZBqkGErMrs8UxrvWAsC5nZCEur7kZAPNhfpPNCIC2ZBSgJClOPvfasON7Cfv2yavtKvANe2WLyd7sJGZAGAarPIuSVZBv5D18eMKoio2yoFmhVtc4ZCZCElSJhf0o4Q6CgGOL7hBdp6ZAbZCIsiS3fqBCH1hUtclPAZCiUMfsrdiZBzvS1ZAk50Utiud2djZASsdFz';
$telefono = '8294014117';
$url = 'https://graph.facebook.com/v17.0/165221420014421/messages';
$mensaje = ''
. '{'
. ' "messaging_product": "whatsapp", '
. ' "to": "'.$telefono.'", '
. ' "type": "interactive",'
. ' "interactive":{'
. ' "type": "list",'
. '"header": {'
. ' "type": "text",'
. ' "text": "Solicitud de Servicios"'
. ' },'
. ' "body": {'
. ' "text": "Instalación: KIT TREN TRASERO COMPLETO RENAULT CANGOO"'
. ' },'
. ' "footer": {'
. ' "text": "Orden: 25869-25123 - Chasis: 53564FWEFW6W1F"'
. ' },'
. ' "action": {'
. ' "button": "ENVIAR PROPUESTA",'
. ' "sections":['
. ' {'
. '"title":"Costo de Instalación",'
. ' "rows": ['
. ' {'
. ' "id":"unique-row-identifier-here",'
. ' "title": "RD$3,500.00",'
. ' "description": "Incluye mant. bola esferica y 30 dias Garantia", '
. ' }'
. ' ]'
. ' },'
. ' {'
. '"title":"Propuesta Adicional",'
. ' "rows": ['
. ' {'
. ' "id":"unique-row-identifier-here",'
. ' "title": "RD$6,500.00",'
. ' "description": "Incl. cambio bolas esfericas y frentil completo.", '
. ' }'
. ' ]'
. ' },'
. ' ]'
. ' }'
. ' }'
. ' }';
$header = array("Authorization: Bearer " . $token, "Content-Type: application/json",);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POSTFIELDS, $mensaje);
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($curl), true);
print_r($response);
$status_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
?>
|