<?php
$curl = curl_init();
$token = "";
$data = [
'phone' => '081XXXXXXX',
'caption' => 'hi', // can be null
'image' => 'https://xxxx.com/poster.png',
];
curl_setopt($curl, CURLOPT_HTTPHEADER,
array(
"Authorization: $token",
)
);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($curl, CURLOPT_URL, "http://app.absen.co.id/api/send-image");
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($curl);
curl_close($curl);
echo "<pre>";
print_r($result);
?>
Request parameters:
Authorization | Required | Your Token from http://app.absen.co.id, can be seen in the menu: Device – Setting |
---|
phone | Required | Target phone number. You can use the country code prefix or not. Example: 081223xxxx |
---|
caption | Optional | Text image must on the format: UTF-8 or UTF-16 string |
---|
image | Required | URL of image file to be sent. Make sure the image has been uploaded on the server and can be accessed by the public. |
---|
support extension | | jpg, jpeg, png, gif |
---|
Related