API - Automation
Introduction
- This example shows you how to create a "Hello World" CallFire XML application using our REST service. By the end of this campaign you will have a phone number which when called will say "Hello World" to the caller and hang-up.
Step 1: Create the CallFire XML
- The CallFire XML, being an open standard, can be created and hosted on client servers or can be hosted in the CallFire cloud. This example will demonstrate both methods using the following XML example:
|
|
<dialplan name="Root">
<play name="play" type="tts" voice="male1">Hello World</play>
</dialplan>
Step 2: Call REST URL
- Call the following REST URL with the POST parameters shown below.
URL
|
|
https://www.callfire.com/cloud/1/callfirexml/campaign
Sample POST Parameters
Required Post Variables:
URL encoded parameters:
|
|
callfireXml=%3Cdialplan+name%3D%22Root%22%3E%3Cplay+name%3D%22play%22+type%3D%22tts%22+voice%3D%22male1%22%3EHello+World%3C%2Fplay%3E%3C%2Fdialplan%3E&inboundPhoneNumber=+8665556525&isInbound=true&campaignName=HelloWorld&apikey=YOUR_API_KEY
Response
|
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<campaignResponse>
<campaignid>87121242</campaignid>
<description>Campaign Created</description>
<successfull>true</successfull>
</campaignResponse>
Next Steps
- . Sending calls for your campaign = PHP Send Call Rest API
- . See CallFire XML Samples
Conclusion
This example has shown how you you can use any REST client to configure HTTP POST parameters to create an inbound CallFire XML campaign and then associate that with a campaign ID. Now you can use the Campaign service to manage it like any other CallFire campaign.