Media Messages

Send Media Messages

$KeyID = 'xxxxxx-f9e0-4e71-a06e-xxxxxxxxxx';
$url = 'https://io.wakit.id/api/messages/send-media';

$data = array(
"to" => 'Recipient number',
"message" => 'The message you want to send',
);

$ch = curl_init($url);
$data["medias"] = new CURLFile('path/to/media.jpg');

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'device-key: ' . $KeyID,
));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);

if (curl_errno($ch)) {
echo 'Error: ' . curl_error($ch);
}
curl_close($ch);
echo $response;

POST https://io.wakit.id/api/messages/send-media

Headers

Name
Type
Description

device-key*

123123

Request Body

Name
Type
Description

to*

String

message*

String

medias*

Files

Last updated

Was this helpful?