Toky API: Integrate your business phone system with your apps

Toky offers many integrations with CRM and business applications with them you can improve your sales and support processes, by automating tasks like call logging, calling customers with a click and more. However, you may have a different CRM, custom software solution or simply you could have a software which can use virtual phone features; for this, we offer an API which can be used by your development team to integrate Toky to the processes of your software.

How does the Toky API work?

The Toky API is a REST interface that allows developers to execute different methods, with which you can run actions in Toky like gathering data, sending SMS and more. To access this API you must use your API Key which you can find in the dashboard of your Toky account.

For using Toky API you must be on a paid plan. If you don't have Toky, you can try it for free

What can your application do with the API?

There are different methods with which you can execute actions on elements of the Toky platform.

Agents

In this group, there are methods to access the list of agents registered in Toky.

https://api.toky.co/v1/agents  

You can get your agent's list in the following JSON structure:

{
"count": 11,
"next": null,
"results": [
  {
  "email": "agent@mail.com",
  "fullname": "Agent Name",
  "created_at": "2017-06-27 19:24:10",
  "last_update": "2017-06-27 19:26:52",
  "last_connection": null,
  "is_admin": "false",
  "phone_number": "+15553456789",
  "phone_country": "ES"
  },
    ...
}

You can use this method to load the Toky agents to your software solution and synchronize their information if required. Learn more about this method in the developers site

CDR (Call Detail Records)

You can use this method to get call data records from Toky.

https://api.toky.co/v1/cdrs  

You can get your call detail records in the following JSON structure:

{
"count": 20,
"next": "https://api.toky.co/v1/cdrs?offset=20&limit=20",
"results": [
  {
    "id": "12903",
    "callid": "3482582a-dc6e-1235-798c-0401336adf01",
    "from": "+551234567",
    "to_number": null,
    "country": "US",
    "caller_id_used": "+12018155555",
    "init_dt": "2017-07-05 21:46:44",
    "start_time": "2017-07-05 21:46:22",
    "end_time": "2017-07-05 21:46:44",
    "duration": "22",
    "agent_id": "carlos__myagent.com",
    "direction": "inbound",
    "web_call": "no"
    },
    ...

}

You can use this method to get the calls registered in your Toky account and import them into your system to generate reports or perform more complex processes. This method also allows a filter with a start date to retrieve information from an initial date. Learn more about this method in the developer site

This method is used in our Google Data Studio Connector so you can generate custom reports with your call history.

Contacts

In this group, you can find methods that will allow you to query, add and update the contacts registered in Toky.

https://api.toky.co/v1/contacts  

You can get your contacts list in the following JSON structure:

{
"count": 20,
"next": "https://api.toky.co/v1/contacts?offset=20&limit=20",
"results": [
  {
  "id": "7103",
  "contact_name": "My contact name",
  "phone": "+15513804333",
  "country_code": "US",
  "city": "Miami",
  "email": "client@company.com",
  "company_name": "The Company"
  },
...
}

You can use this method to keep Toky contacts synchronized with your software system; this way you can feed the Toky caller ID and help the identification of call history records if you use the CDR method. Learn more about this method in the developer site

SMS

In this group, there are methods that will allow you to list your phone numbers enabled for SMS, send and check the text messages that pass through the Toky platform.

https://api.toky.co/v1/sms  

This a sample of the text messages list JSON structure:

{
"count": 20,
"next": "https://api.toky.co/v1/sms?offset=20&limit=20",
"results": [
      {
    "date": "2017-07-25 21:58:21",
    "from": "+12018172555",
    "to": "+595981222333",
    "text": "hello",
    "direction": "outbound"
    },
      {
    "date": "2017-07-25 21:53:56",
    "from": "+12018172555",
    "to": "+5959811222333",
    "text": "Hi!",
    "direction": "inbound"
    },....

}

You can use this method to send text messages from your own applications; SMS are very useful for user validation processes, notifications and SMS marketing campaigns. Learn more about this method in the developer site

The API methods for SMS are used in our add-on for Google Sheets Bulk SMS Sender

Voicemail

In this group, there are the methods that allow you to get the voicemails received in Toky and even request the internal URL so that you can reproduce it directly with a click.

https://api.toky.co/v1/voicemails  

Example of voicemail records:

{
  "count": 20,
  "next": "https://api.toky.co/v1/voicemails?offset=20&limit=20",
  "results": [
    {
  "id": "e97e1084-2c0b-11e8-a2de-65b3c0049491",
  "created_at": "2017-03-20 06:57:44",
  "from": "+19725456944444",
  "duration": "18"
  },
    {
  "id": "ac78f30e-2b96-11e8-a459-5f65810cf8cb",
  "created_at": "2017-03-19 16:58:17",
  "from": "+197254666666",
  "duration": "5"
    }, ...

}

You can use this method to keep in your system a list of the voicemails left by the customers, generate statistics or open the audios of the voicemails in the Toky platform from your system. Learn more about this method in the developer site

Webhooks

With Toky's webhooks you can subscribe your application to events such as calls, voicemails and SMS. When an event is executed, Toky will send a message automatically to your app, allowing you to keep information update and being able to execute related processes almost immediately.

https://api.toky.co/v1/webhooks  

Example of the information sent by a webhook registered to the New_Call event:

[{
"direction":"inbound",
"web_call":"no",
"agent":"your.toky@agent",
"duration":0,
"state":"missed",
"from_number":"+13013372465",
"to_number":"+12018442465",
"date":"2017-08-21T16:02:21-05:00",
"record_url":"",
"caller_name":"",
"caller_email":"",
"caller_country":"",
"caller_phone_number":"",
"contact_name" : "john doe office",
"contact_email" : "john@email.com",
"ivr_option_pressed": 1,
'reply_code' : '487',  
"error_message' : "Cancelled"
}]

You can use the webhooks not only to keep the information of calls, SMS and voicemail synchronized in your application, but also to execute processes from your applications or invoke other APIs with this data. Learn more about this method in the developer site

There are many ways in which your business will improve support and sales processes using Toky virtual phone system. If you still do not know Toky, try it for free

comments powered by Disqus