API Add Device

This API is used to add device via API, so your application doesn't have to create manually on fonnte's dashboard.

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.fonnte.com/add-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','device' => '08123456789','autoread' => 'false','personal' => 'false','group' => 'false'),
  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
  • 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

If you prefer to see on postman, see here.

The token is not device token! but account token.

You can only add up to 10 free devices.

example : you create 10 free devices for your clients, then 5 of them order and no longer free devices. so you can add 5 more of free devices.

However, you can only connect 1 free device out of all your free devices.

Response

Successfull response

{
    "autoread": "off",
    "device": "08123456789",
    "group": "off",
    "name": "device name",
    "personal": "off",
    "status": true,
    "token": "M@N!4Yr-Vs#CPtaopCkE"
}

on successfull device creation, you can get the basic info of the device including token.

- input invalid : there is something wrong with your data

{
    "reason": "input invalid",
    "status": false
}

- unknown user : invalid/empty account token

{
    "reason": "unknown user",
    "status": false
}

- too much free device : your account has already 10 free devices

{
    "reason": "too much free device",
    "status": false
}

- device already exist : the device number is already exist, may or may not in your account

{
    "reason": "device already exist",
    "status": false
}

Related knowledge

See more
Made with in Indonesia