This API used to get information about your device

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.fonnte.com/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_HTTPHEADER => array(
    'Authorization: TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

If you prefer to see on postman, see here

TOKEN must be filled by your own token. See how to get token.

Result :

{
    "device": "6282227097005",
    "device_status": "connect",
    "expired": "18 November 2029",
    "messages": 16785,
    "name": "Fonnte admin",
    "package": "Reguler",
    "quota": "78",
    "status": true
}

Available JSON output

if somehow token is not correct, response status will be false

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

This API is used to get all devices information on an account.

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.fonnte.com/get-devices',
  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_HTTPHEADER => array(
    'Authorization: TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

The token is not device token! but account token.

If you prefer to see on postman, see here.

Response

Successfull response

{
    "connected": 0,
    "data": [
        {
            "autoread": "off",
            "device": "6287866250310",
            "expired": "1707782400",
            "name": "tutorial",
            "package": "Free",
            "quota": "1000",
            "status": "disconnect",
            "token": "sUqjkKH+UG+@3SmnKrhz"
        }
    ],
    "devices": 1,
    "messages": 0,
    "status": true,
    "type": "device"
}

Info :

- unknown user : your account token is invalid

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

On 14 January 2024, fonnte introduce another token which is primarily used to manage device API.

This account token will enable you to get all devices information, including how much is connect, how much is total messages requested, devices information, etc.

The other usage of this token is to do add device, update device and delete device programatically.

The device API is helping a lot on building your own integrated dashboard!

You can find this token on setting menu.

Screenshot 401

Webhook device status is used to get device status in real time.

This webhook is primarily used if you want to create your own dashboard, then when your client is connecting, the status of the device should also updated.

With this webhook, your device data should correctly updated and reduce the need of hitting api device profile repeatedly which is limited.

Furthermore, you can also use this webhook to notify your client when their device is disconnected along with it's reason.

The example below show how do you get the device status, you can modify as you need.

<?php
header('Content-Type: application/json; charset=utf-8');
$json = file_get_contents('php://input');
$data = json_decode($json, true);
$device = $data['device'];
$status= $data['status'];
$timestamp= $data['timestamp'];
$reason = isset($data['reason'])? $data['reason']:"";

Available parameter

Poll menu is used to make a poll.

You can use the poll on send menu or autoreply menu.

example output :

The field you need to fill is shown below.

The fields of template is shown above.

After you finish adding the poll, you can click add and the poll will be added and ready to use.

Warning! The use of this API is not intended for frontend usage as it exposes a token that must be kept confidential. This API usage is highly not recommended unless there are specific issues with your environment preventing you from utilizing the POST method. Please use it wisely.

This API enable send message using GET method or simply using url.

you can run it on browser/put the link on button/href tag.

The url is simply using the same url as POST method.

https://api.fonnte.com/send/?queries

Queries is the query string with name and values.

If you prefer to see on postman, see here.

Available parameter

note :

  1. all value should be encoded before assigned to avoid any error/unexpected behaviour, see urlencode from php.
  2. redirect parameter will redirect the page after used. if your environment support curl, it's recommended to verify and log the response before redirecting/action as not all get request will return success due to invalid value.
  3. please note that file parameter not available in this method, to send a file must use url

Use Case

First of all, do not use this api in frontend! anyone can use your device to send message.

You can use this API for backend or internal use.

The only use case of this API is when your environment do not support POST method.

Sometime even curl is not available on some environment.

If that's the case, you can use it with care.

Response

All response will follow the response for API send message POST method

This template menu can be used as quick reply on cs multi agent dashboard.

You can set the message including attachment (depend on your device's package) and location.

The fields of template is shown above.

After you finish adding the template, you can click add and the template will be added and ready to use.

The agent who will receive and reply chat on cs multi agent dashboard can be managed from this menu.

The agent can only manage by device and can only fit in one division.

The fields of agent is shown above.

After you finish adding the agent, you can click add and the agent will be added and ready to use.

The agent token is important.

You will need device number and token to be able to log in to cs multi agent dashboard.

Division is a feature to grup agents to organize better.

You can organize incoming message to your agent's rotation using division.

Division can accept agent with different devices.

with this feature, you can manage incoming message from multiple devices, if required.

but still, one device per division is recommended method.

The fields of division is shown above.

After you finish adding the division, you can click add and the division will be added and ready to use.

Fonnte introduce rotation on rotator and cs division menu.

The rortation is a simple select with option :

Full means the rotation will make a full cycle until all element have been selected.

Partial means the rotation will only affect current rotation, therefore the element may be chosen again in the next rotation.

Example :

Case A have 3 elements of (a,b,c) with full rotation.

The first occurence chose b.

The second occurence will only choose one of a or c (b is excluded)

The third occurence is the remainder.

The fourth occurence will reset the rotation to choose one of (a,b,c).

Case B have 3 elements of (a,b,c) with partial rotation

The first occurence chose b.

The second occurence will choose one of a, b, c (b may be chosen again)

Made with in Indonesia