Chat API

FONE API's Programmable Chat allows you to add chat to web & mobile apps
Home
API

Deliver your message

All members of a channel will get the message from FONE API And if one member is offline, the message is queued for delivery.

1
channel.sendMessage("Draw the owl!")
1
2
3
4
5
6
channel.sendMessage("Draw the NSString *message = @"Draw the owl!";
[self.channel.messages sendMessage:message completion:^(foneapiMLResult result) {
  if (result != foneapiMLResultFailure) {
    NSLog(@"message sent...%@", result);
  }
}];owl!")
1
2
3
4
5
6
let message: foneapiMLMessage = channel.messages.createMessageWithBody("Draw the owl!")
channel.messages.sendMessage(message) { result in
  if result == .Success {
    print("Message sent %@", result)
  }
}
1
2
3
4
5
6
7
8
Message message = messagesObject.createMessage("Draw the owl!");

messagesObject.sendMessage(message, new StatusListener() {
  @Override
  public void onSuccess() {
    logger.e("Successful at sending message.");
  }
});

Get the message

Channels get notifications when new messages are received. Route the events client-side or query for a particular message.

1
channel.sendMessage("Draw the owl!")
1
channel.sendMessage("Draw the owl!")
1
2
3
4
5
6
7
8
extension ViewController: foneapiMLIPMessagingClientDelegate {

  // Called whenever a channel we've joined receives a new message
  func ipMessagingClient(client: foneapiMLIPMessagingClient!, channel: TMChannel!,
      messageAdded message: TMMessage!) {
    print("\(message.author) said: \(message.body)")
  }
}
1
2
3
4
@Override
public void onMessageAdd(Message message) {
  System.out.println("message added");
}

Access chat history

Conveniently stored in the cloud and synced across devices, get instant access to channel history anytime you want.

1
2
3
4
5
6
7
channel.getMessages(25)
  .then(function(messages) {
    for (i=0; i<messages.length; i++) {
      var message = messages[i];
      console.log('Message: ' + message.body);
    }
});
1
2
3
4
5
NSArray *messages = self.channel.messages.allObjects;
NSLog(@"joined general channel with the following messages: %@", messages);
for (id msg in messages) {
  NSLog(@"Message:%@", msg);
}
1
2
3
4
let allMessages = channel.messages.allObjects()
for message in allMessages {
  print("message body: \(message.body)")
}
1
2
3
4
5
6
Messages messagesObject = channel.getMessages();

Message[] messagesArray = messagesObject.getMessages();
for(int x = 0; x< messagesArray.length; x++) {
  System.out.println("Message body:" + messagesArray[x]);
}

Register to typing indicator

Get to know when someone is typing through the typing indicator. Establish a manager to process the event.

1
2
3
4
5
6
// Set up the listener for the typing started Channel event
activeChannel.on('typingStarted', function(member) {

  // Process the member to show typing
  console.log("typing started for " + member);
});
1
2
3
-(void)ipMessagingClient:(foneapiPMessagingClient *)client typingStartedOnChannel:(foneapiMChannel *)channel member:(foneapiMMember *)member {
  NSLog(@"typing started for %@", member);
}
1
2
3
func ipMessagingClient:(foneapiPMessagingClient!, channel: foneapiMChannel!, member: iCEMMember  {
  NSLog(@"typing started for %@", member);
}
1
2
3
public void onTypingStarted(Member member){
  System.out.println("typing started for " +  member);
}

CHAT API

Use REST APIs to incorporate backend logic to your chat server.

Send a message

Deliver your message across channels from any user right from your backend.

1
2
3
var client = new foneapiMLIpMessagingClient(accountSid, authToken);
Message message = client.CreateMessage(serviceSid, channelSid, memberSid, body);
Console.WriteLine(message);
1
2
3
4
final Map<String, String> messageParams = new HashMap<String, String>();
messageParams.put("Body", "MESSAGE");
Message message = channel.getMessages().create(messageParams);
System.out.println(message);
1
2
3
4
5
6
7
service.channels('CHANNEL_ID').messages('MESSAGE_ID').create({
  body: 'MESSAGE'
}).then(function(response) {
  console.log(response);
}).fail(function(error) {
  console.log(error);
});
1
2
3
4
$message = $channel->messages->create(array(
  "body" => "MESSAGE",
));
print $message
1
2
messages = channel.messages.create(body="MESSAGE")
print message
1
2
3
4
service = ip_messaging_client.services.get('SERVICE_SID')
channel = service.channels.get('CHANNEL_SID')
response = channel.messages.create(body:'MESSAGE')
puts response
1
2
3
4
service = ip_messaging_client.services.get('SERVICE_SID')
channel = service.channels.get('CHANNEL_SID')
response = channel.messages.create(body:'MESSAGE')
puts response

Apply Keyword Filters

Get webhooks for every message to enable you to parse keywords and execute intelligent logic.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
[HttpPost]
public ActionResult IpMsgWebhook(string from, string to, string body, string trigger)
{
  if(trigger == "onMessageSend")
  {
    return WebBot.ProcessMessage(from, to, body);
  }
  return new HttpStatusCodeResult(200);
}channel.messages.create(body:'MESSAGE')
puts response
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
@WebServlet("/ip-msg-webhook")
public class IpmServlet extends HttpServlet {
  public void doGet(HttpServletRequest request, HttpServletResponse response)
      throws IOException {
    if (request.getParameter("trigger") == "onMessageSend") {
      String message = request.getParameter("message");
      String to = request.getParameter("to");
      String from = request.getParameter("from");
      processMessage(message, to, from);
    }
    response.getWriter().println("received message");
  }
}
1
2
3
4
5
6
7
8
9
app.post('/ip-msg-webhook', function(request, response) {
  var trigger = request.query.trigger;

  if (trigger == 'onMessageSend') {
    sendToWebbot(request, response);
  } else {
    response.sendStatus(200);
  }
});
1
2
3
4
if ($_GET['trigger'] == 'onMessageSend') {
  processMessage($_GET['message'], $_GET['to'], $_GET['from']);
}
echo "received message";
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
from flask import Flask, request
app = Flask(__name__)

@app.route("/ip-msg-webhook")
def ipm_webhook():
    if request.args.get("trigger") == "onMessageSend"
        message = request.args.get("message")
        to = request.args.get("to")
        from_ = request.args.get("from")
        process_message(message, to, from_)

    return "received message"

if __name__ == "__main__":
    app.run()
1
2
3
4
5
6
7
8
require 'sinatra'

get '/ip-msg-webhook' do
  if params[:trigger] == 'onMessageSend'
    process_message params[:message], params[:to], params[:from]
  else
    "received message"
end
1
2
3
4
5
6
7
8
# Nothing to see, here's an owl instead.

	              , _ ,
	             ( o o )
	            /'` ' `'\
	            |'''''''|
	            |\\'''//|
	               """

Add more channel members

Assign users to a channel through programs. To aid use cases, add a client and an agent in one channel.

1
2
3
var client = new foneapiMLIpMessagingClient(accountSid, authToken);
Member member = client.CreateMember(credentialSid, channelSid, identity, roleSid);
Console.WriteLine(member);
1
2
3
4
final Map<String, String> memberParams = new HashMap<String, String>();
memberParams.put("Identity", "IDENTITY");
Member member = Channel.getMembers().create(memberParams);
System.out.println(member);
1
2
3
4
5
6
7
service.channels('CHANNEL_SID').members.create({
  identity: "IDENTITY"
}).then(function(response) {
  console.log(response);
}).fail(function(error) {
  console.log(error);
});
1
2
3
4
$member = $channel->members.create(array(
  "identity" => "IDENTITY",
));
print $member;
1
2
3
4
service = client.services.get(sid="SERVICE_SID")
channel = service.channels.get(sid="CHANNEL_SID")
member = channel.members.create(identity="IDENTITY")
print member
1
2
3
4
service = ip_messaging_client.services.get('SERVICE_SID')
channel = service.channels.get('CHANNEL_SID')
member = channel.members.create(Identity:'IDENTITY')
puts member
1
2
3
curl -XPOST https://chat.foneapi.com/v1/Services/{service sid}/Channels/{Channel SID}/Members \
  -d "Identity=kwhinnery" \
  -u '{foneapi account sid}:{foneapi auth token}'
The Fone API Edge
Redundancy

Automated failover ensures that you have 99.95% uptime SLA without the need for a maintenance window.

Scalability

Use existing apps to new markets by configuring features for compliance and localization.

Multi-channel

Use a single platform for voice, SMS, video, authentication, chat and more.

Without hassles

Get free support, have the freedom to scale your business, market faster with pay-as-you-go.

Create your Account to Start Building
Reach us through these channels?
voice
video
messaging
email
social
CLOSE WIDGET
Voice Channel
Click To Call
Get A CallBack
Show Number To Call
CLOSE WIDGET
Click to Call
000
1
.
2
ABC
3
DEF
4
GHI
5
JKL
6
MNO
7
PQRS
8
TUVW
9
XYZ
*
.
0
+
#
.
Audio
Audio
Mute
Mute
Dialer
Dialer
End Call
End call
CLOSE WIDGET
Get A Call Back
000
1
.
2
ABC
3
DEF
4
GHI
5
JKL
6
MNO
7
PQRS
8
TUVW
9
XYZ
*
.
0
+
#
.
Enter Phone Number for Call Back
CLOSE WIDGET
Show Number To Call
000
This is your Business Number
CLOSE WIDGET
Messaging Channel
Text/SMS
OTT/Messaging Apps
Chat
CLOSE WIDGET
SMS/Text
000
This is your Business Number
CLOSE WIDGET
OTT/Messaging Apps
Talk to us using you favorite app!
Facebook msg
line
whatsapp
wechat
viber
yahoo msg
kakao talk
skype
kik msg
hangouts
Snapchat
CLOSE WIDGET
Facebook Messenger

Connect to your Facebook Messenger account to receive alerts and talk with us using Facebook Messenger app!

FACEBOOK MESSENGER
Click to connect
CLOSE WIDGET
Line

Connect to your Line account to receive alerts and talk with us using Line app!

Line
Click to connect
CLOSE WIDGET
Whatsapp

Connect to your Whatsapp account to receive alerts and talk with us using Whatsapp app!

Whatsapp
Click to connect
CLOSE WIDGET
Wechat

Connect to your Wechat account to receive alerts and talk with us using Wechat app!

wechat
Click to connect
CLOSE WIDGET
Viber

Connect to your Viber account to receive alerts and talk with us using Viber app!

viber
Click to connect
CLOSE WIDGET
Yahoo Messenger

Connect to your Yahoo Messenger account to receive alerts and talk with us using Facebook Messenger app!

yahoo MESSENGER
Click to connect
CLOSE WIDGET
Kakao

Connect to your Kakao account to receive alerts and talk with us using Kakao app!

FACEBOOK MESSENGER
Click to connect
CLOSE WIDGET
Skype

Connect to your Skype account to receive alerts and talk with us using Skype app!

skype
Click to connect
CLOSE WIDGET
Kik Messenger

Connect to your Kik Messenger account to receive alerts and talk with us using Kik Messenger app!

kik MESSENGER
Click to connect
CLOSE WIDGET
Hangouts

Connect to your Hangout account to receive alerts and talk with us using Hangout app!

Hangout
Click to connect
CLOSE WIDGET
Snapchat

Connect to your Snapchat account to receive alerts and talk with us using Snapchat app!

snapchat
Click to connect
CLOSE WIDGET
Chat Conversation
We love to talk with you! Leave a chat message down below.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
CLOSE WIDGET
Voice Channel
Video Call an Agent
Screenshare & chat
CLOSE WIDGET
Video Call
Audio
Audio
Mute
Mute
End Call
End call
CLOSE WIDGET
Screenshare & chat
Hangout

to the UconnectedIT agent

Click to share access
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
CLOSE WIDGET
Fill form for email
Click to email
CLOSE WIDGET
Fill form for email
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
CLOSE WIDGET
Click to email
Talk to us using you favorite email client!
Default Email Client
Snapchat
CLOSE WIDGET
OTT/Messaging Apps
FACEBOOK POST
TWITTER POST
LINKEDIN POST
INSTAGRAM
PINTEREST
CLOSE WIDGET
Facebook Post
Make a post on Facebook
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
CLOSE WIDGET
Twitter Post
Make a post on Twitter
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
CLOSE WIDGET
Linkedin Post
Make a post on Linkedin
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
CLOSE WIDGET
Instagram Post
Make a post on Instagram
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
CLOSE WIDGET
Pinterest Post
Make a post on Pinterest
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
CLOSE WIDGET