lucascardo12
3 years ago
3 changed files with 75 additions and 1 deletions
@ -0,0 +1,36 @@
|
||||
<?php |
||||
include dirname(__DIR__) . '\includes\config.php'; |
||||
require dirname(__DIR__) . '\vendor\autoload.php'; |
||||
|
||||
use app\Providers\RequestURL; |
||||
|
||||
$request = new RequestURL(); |
||||
$varre = file_get_contents("C:\Users\Desenvolvimento03\Downloads\WhatsApp Ptt 2021-12-01 at 13.42.23.ogg"); |
||||
$url = 'http://192.168.115.65:8081/api/enviaMsg'; |
||||
$data = ["event" => [ |
||||
"type" => |
||||
"mensagem", "contact" => [ |
||||
"name" => "Lucas", |
||||
"number" => "1040", |
||||
"matricula" => "" |
||||
], |
||||
"mensagem" => [ |
||||
"type" => "audio", |
||||
"content" => base64_encode($varre), |
||||
"id_provedor" => '6545243524333', |
||||
"dst" => "556596107663", |
||||
"uniqueid" => 1638196372, |
||||
"media" => "whatsapp", |
||||
"datetime" => 1638196372, |
||||
"status" => "sent", |
||||
"mimetype" => "audio/ogg" |
||||
] |
||||
]]; |
||||
$request->setUrl($url); |
||||
$header = array(); |
||||
$header[] = 'Content-Type: application/json'; |
||||
$request->post_field(json_encode($data), true); |
||||
$request->header($header); |
||||
$request->method_request("POST"); |
||||
$response = $request->exec_request(); |
||||
// echo base64_encode($varre); |
@ -0,0 +1,37 @@
|
||||
<?php |
||||
include dirname(__DIR__) . '\includes\config.php'; |
||||
require dirname(__DIR__) . '\vendor\autoload.php'; |
||||
|
||||
use app\Providers\RequestURL; |
||||
|
||||
$request = new RequestURL(); |
||||
$varre = file_get_contents("C:\Users\Desenvolvimento03\Downloads\Bruno_c_moreira.pdf"); |
||||
$url = 'http://192.168.115.65:8081/api/enviaMsg'; |
||||
$data = ["event" => [ |
||||
"type" => |
||||
"mensagem", "contact" => [ |
||||
"name" => "Lucas", |
||||
"number" => "1040", |
||||
"matricula" => "" |
||||
], |
||||
"mensagem" => [ |
||||
"type" => "document", |
||||
"content" => base64_encode($varre), |
||||
"id_provedor" => '6545243524333', |
||||
"dst" => "556596107663", |
||||
"uniqueid" => 1638196372, |
||||
"file_name" => 'bruno', |
||||
"media" => "whatsapp", |
||||
"datetime" => 1638196372, |
||||
"status" => "sent", |
||||
"mimetype" => "application/pdf" |
||||
] |
||||
]]; |
||||
$request->setUrl($url); |
||||
$header = array(); |
||||
$header[] = 'Content-Type: application/json'; |
||||
$request->post_field(json_encode($data), true); |
||||
$request->header($header); |
||||
$request->method_request("POST"); |
||||
$response = $request->exec_request(); |
||||
// echo base64_encode($varre); |
Loading…
Reference in new issue