ai data is a menu to add more information to your ai.

this is useful to add your own data so ai can use this data to respond to your user.

this data has maximum 10.000 characters each.

Screenshot 514

Calculation

To add data, you will need data allowance.

as a start, every device will have 3 allowance.

you can delete/edit old data and create new data.

for 2.000 - 2.500 characters, it will be using 1 ai quota when used.

if your data around 8.000-10.000 characters, everytime this data is used, you will be cost al least 4 ai quota.

the more characters you have, the more expensive it is to be used.

to be able to send ai message, you need ai quota.

the ai quota can be ordered through order menu.

this ai quota have no expiration date.

as long as your device exist, the ai quota will also exist unless depleted due to be used.

Calculation

the ai quota will be calculated twice :

so basically you will need at least 2 ai quota per chat.

why is at least? will it cost more than 2 per chat?

yes, it's all based on your data length and response length.

so in a typical chat, 1000 ai quota can be used to generate up to 500 chats

having ai indeed can help adding productivity.

currently ai is used only for chatbot.

you can use this ai feature with the help of flow menu.

Screenshot 512

by creating the flow, your ai is ready to be used.

Requirement

You will need quota ai to use this ai feature.

everytime you send an ai reply, your quota ai will be deducted.

you can also use your own data set you can add in the ai data menu.

with your own data, your ai will be personalized to your needs

Setup

To use this ai, it's pretty straightforward.

you can go to flow menu, then create the flow and use ai as reply.

your ai will use your own data (if any) to response to the chat.

Fonnte is does not wish to store any of your data, literally.

So, fonnte delete your data, regularly.

As per this documentation is written, these are the list and the lifecycle of how long will they stored on fonnte.

UtililyLifetimeInfo
DeviceLifetimeDevice no longer automatically deleted
Whatsapp SessionLifetimeIf nothing goes wrong, Fonnte will keep your whatsapp session active. your session may end only when there is something wrong. most likely comes from whatsapp that terminate your session/get banned/corrupted session. you'll get notification about it when disconnected.
Temporary Files7 daysFonnte store your files as temporary files whenever you send an attachment via dashboard or via API using parameter file.
Webhook Files30 minutesFonnte does not wish to save any attachment sent to you for prrivacy reason. but it is required to send the file back to you via webhook. so we store it for a short time. fonnte only store attachment if you are using webhook and ignore if you are not using webhook.
Scheduled Files7 daysYour scheduled to be sent files will be checked every minute to make sure all scheduled messages using this files is already processed. only after that, the file is deleted.
Account30 daysWhen the account does not have any device left (all devices deleted automatically), the timer begin the countdown to delete the account. Deleted account will also deleted all data related to the account and leave no trace the account ever existed. login reset the timer.

This API is used to delete a message via API.

You can delete the requested message you don't want to proceed anymore or other reason EXCEPT message with status processing.

processing message cannot be deleted.

if you want to delete it, you have to disconnect your device first, the processing message will changed to pending.

This way you can delete it.

<?php

$curl = curl_init();

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

$response = curl_exec($curl);

curl_close($curl);
echo $response;

If you prefer to see on postman, see here.

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

Response

Successfull response

{
    "detail": "message 1 successfully deleted",
    "status": true
}

- invalid device : invalid token

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

- invalid message id : the message id does not exist or does not belong to your device.

{
    "reason": "invalid message id",
    "status": false
}

- cannot delete message with status processing : the message is being processed. message cannot be deleted

{
    "reason": "cannot delete message with status processing",
    "status": false
}

This API is used to delete a device via API.

Before proceed, the only way to delete device is by giving correct OTP code.

The OTP code is sent to the whatsapp number on the setting menu.

<?php

$curl = curl_init();

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

$response = curl_exec($curl);

curl_close($curl);
echo $response;

If you prefer to see on postman, see here.

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

Response

Successfull response

{
    "detail": "device 08123456789 successfully deleted",
    "status": true
}

- invalid device : invalid token

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

This API will disconnect connected device.

<?php

$curl = curl_init();

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

Response

Successfull response

{
    "detail": "device disconnected",
    "status": true
}

- Token invalid : token is not valid

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

- Device already disconnected : the device is disconnected already

{
    "detail": "device already disconnected",
    "status": false
}

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

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
}

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

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
}

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
}
Ask Fai
Made with in Indonesia