Docs

Implementing callback functionality

 

Step 1. Prerequisites

1. Register at apifonica.com and create an Apifonica account, if you have not done so already.

2. Rent an Apifonica local or virtual phone number to be used for calling.

You can find instructions on registering Apifonica accounts and renting numbers here.

Step 2. Creating Files and Applications

1. Create a simple XML file and upload the created XML to your server.

2. Create an application and associate the XML file you have created with it.

Detailed instructions on creating XML files and applications can be found here.

Step 3. Making the callback

1. Making the callback using Console (Make voice call):

  • make the POST request to /accounts/{accountSID}/calls
  • "from" parameter is a number rented from Apifonica
  • "to" parameter is a number which receives the call (point 1)
  • Call_app_sid” parameter is Application SID of created application in which a link to XML is set up (point 2)

2. Making the callback using personal account:

  • Go to Sandbox
  • Choose accountSID in the list of your accounts/subaccounts
  • Choose "from" parameter in the list of numbers rented from Apifonica
  • Fill in "to" parameter - a number which receives the call (point 1)
  • Choose "Controller" parameter – find in the list of created applications the name of application in which a link to XML is set up (point 2)

3. After that the call is connected between the customer and the user.

Step 4. Statistics

1. To get statistics (logs) please use console to make the GET request to /accounts/{accountSID}/calls (get call history).

2. To get the list of expenses please make the GET request to /accounts/{accountSID}/balance/expenses (get expenses history) or via personal account.

You can implement this functionality into virtually everything that supports html. For example, setting up a simple website allows you to have plain text link to it directly in your company’s e-mails.