<?php session_start();?>
<?php include('../_cfg/config.php');?>
<?php include('php_gene1.php'); ?>
<?php include('php_session.php');?>
<div>
  
<?php
echo 'TEST 3';

echo '<br>';
echo '*/*/*/*/*/*/';
echo '<br>'.date('H:i:s');
echo '<br>';

  
// $numero='5930996030568';
$numero='5930998898014';
$mensaje='prueba de chat-api '.chr(10).date('Y-m-d H:i:s');
$token='kcwgm3bej7ry3yqp';
 
//    $mensaje='http://vcrxol.com/_cel/202009/0209202001099311998900120011010000000803297491711.pdf';

//    $mensaje='http://vare.vcrxol.com/_doc/FC10_000000555.html';
//    echo $mensaje;
   
echo send_wsapp1($numero,$mensaje,$token);   
   die();

   
//  echo send_wsapp1file($numero,$mensaje,$token);   

// {
//   "webhookUrl": "http://vcrxol.com/_lib/wh_vcrxol.php"
// }   
   
  $data = ['webhookUrl' => 'http://vcrxol.com/_lib/wh_vcrxol.php',];
//   $data = ['webhookUrl' => 'http:\vcrxol.com\_lib\wh_vcrxol.php',];
  $json = json_encode($data); // Encode data to JSON
   
   $url='https://api.chat-api.com/instance124026/webhook?token='.$token;
//    $json='';
    
   echo '<br>';
   echo 'JSON'. $json;
   
  // Make a POST request
  $options = stream_context_create(['http' => [
          'method'  => 'POST',
          'header'  => 'Content-type: application/json',
          'content' => $json
          ]
          ]);
   
   echo '<br>';
echo $options;   
  // Send a request
  $result = file_get_contents($url, false, $options); 
   echo '<br>';
   echo $url;
  $result = file_get_contents($url);  
   
  return $result;
   
   
   
   
echo '<br>';
echo '*/*/*/*/*/*/';  
echo '<br>'.date('H:i:s');
  
?>
  
  
  
<?php
  
  
echo date('H:i:s');
  
die(); 
?>
</div>
