1. Home
  2. Docs
  3. Dokumentasi API
  4. POST /api/send-document

POST /api/send-document

$curl = curl_init();
$token = "";
$data = [
    'phone' => '081XXXXXXX',
    'caption' => 'hi', // can be null
    'document' => 'https://xxxx.com/poster.pdf',

curl_setopt($curl, CURLOPT_HTTPHEADER,
        "Authorization: $token",
curl_setopt($curl, CURLOPT_URL, "http://app.absen.co.id/api/send-document");
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_SSL_VERIFYHOST, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($curl);

echo "<pre>";

Request parameters:
AuthorizationRequiredYour Token from http://app.absen.co.id, can be seen in the menu: Device – Setting
phoneRequiredTarget phone number. You can use the country code prefix or not. Example: 081223xxxx
captionOptionalText document on the format: UTF-8 or UTF-16 string
documentRequiredThe document file URL to be sent. Make sure documents have been uploaded on the server and can be accessed by the public.
support extensiondoc, docx, pdf, odt, csv, ppt, pptx, xls, xlsx, mp3, ogg, jpg, jpeg, png