API Update Device

This API is used to update your existing device via API

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.fonnte.com/update-device',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('name' => 'device name','webhook' => 'https://webhookurl.com','webhookconnect' => 'https://webhookurl.com','webhookstatus' => 'https://webhookurl.com','webhookchaining' => 'https://webhookurl.com','autoread' => 'false','personal' => 'false','group' => 'false','quick' => 'false','resend' => 'false','target' => '08123456789','countryCode' => '62'),
  CURLOPT_HTTPHEADER => array(
    'Authorization: TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Available parameter

  • name (required) (string) - device's name, min 2 max 30
  • webhook (optional) (string) - url to receive incoming chat
  • webhookconnect (optional) (string) - url to receive connection event
  • webhookstatus (optional) (string) - url to receive updated message status
  • webhookchaining (optional) (string) - url to receive response of chaining message
  • device (required) (string) - device's number (not neccessarily whatsapp number),must unique accross all user, min 8 max 15
  • autoread (optional) (bool) : activate autoread chat feature, boolean
  • personal (optional) (bool) : autoread personal chat, boolean
  • group (optional) (bool) : autoread group chat, boolean
  • quick (optional) (bool) : autoread self chat, boolean
  • resend (optional) (bool) : forward incoming attachment, boolean
  • target (optional) (string) : target number for resend feature, string
  • countryCode (optional) (string) : county code of the target,default 62

If you prefer to see on postman, see here.

The token is device token. see how to get token.

Response

Successfull response

{
    "detail": "device updated!",
    "status": true
}

- device not found : invalid token

{
    "reason": "device not found",
    "status": false
}

- start with webhook url : something wrong with your webhook url

{
    "reason": "webhook url *",
    "status": false
}

Related knowledge

See more
Made with in Indonesia