CallFire Solutions

Create Auto Reply

Follow

CREATE AUTO REPLY

This method configures and sends an auto-reply message for an existing Id.

Auto-Replies are text messages sent to a customer when a customer replies to a text message coming from a campaign. There are two different ways of creating an auto-reply. One of them is to use a phone number that you have bought and adding the message to be sent (without keyword). Look at example 1.

The other way is using the short number "67076" and a keyword which will be the trigger to send the message. Look example 2.

To purchase a keyword see this guide [include link once that guide is ready].

Request Parameters

ParameterDemo ValueDescriptionData Type
CreateAutoReply   Create AutoReply using attached info object
RequestId   anyURI
AutoReply     object
id Unique ID of Text Auto Reply long
Number Phone number to configure an auto reply message PhoneNumber
Keyword   string
Match   string
Message   string

Response Parameters

<table class="params-table">
    <tbody>
        <tr>
            <th class="param-name">Parameter</th>
            <th class="param-documentation" style="width: 200px; max-width: 200px;">Description</th>
            <th class="param-type">Data Type</th>
        </tr>
        <tr class="param-row operation-response  " id="CreatedId">
            <td class="param-name level-0">CreatedId</td>
            <td class="param-documentation">Unique ID of resource</td>
            <td class="param-type">long</td>
        </tr>
    </tbody>

 

Responses Status Codes

200, success

The request has been finished successfully.

400, bad request

This error code has a lot of possible causes, such as an account error, or an incorrect parameter. First of all, check that all parameters have the correct data or data type. If the error persists, contact CallFire support.

401, not authorized

The username or password has some error. Perhaps the login has expired. Make sure that you valid account.

404, not found

The ID or Number that you are trying to edit or get was not found; you should check to see if it is correct.

500, internal error

This error is not caused by the user, but is CallFire's. Please contact support.

Example 1: AutoReply


using RestSharp;

namespace [your-namespace]
{
    public class [your-class]
    {
        public string CreateAutoReply()
        {
            var client = new RestClient("https://www.callfire.com/api/1.1/rest/");
            client.Authenticator = new HttpBasicAuthenticator("YourLoginId", "password");

            var request = new RestRequest("text/auto-reply", Method.POST);
            request.AddParameter("Number", "18185551212"); 
            request.AddParameter("Message", "Thank you for message");

            var response = client.Execute(request);
            string content = response.Content;
            return content;
    }
}

The XML returned is:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<r:ResourceReference xmlns="http://api.callfire.com/data" xmlns:r="http://api.callfire.com/resource">

    <r:Id>3552074003</r:Id>

<r:Location>https://www.callfire.com/api/1.1/rest/text/auto-reply/3552074003</r:Location>

</r:ResourceReference>

Example 2: AutoReply


using RestSharp;

namespace [your-namespace]
{
    public class [your-class]
    {
        public string CreateAutoReply()
        {
            var client = new RestClient("https://www.callfire.com/api/1.1/rest/");
            client.Authenticator = new HttpBasicAuthenticator("YourLoginId", "password");

            var request = new RestRequest("text/auto-reply", Method.POST);
            request.AddParameter("Number", "67076");
            request.AddParameter("Keyword", "Chocolate");
            request.AddParameter("Message", "Thank you for choosing chocolate");

            var response = client.Execute(request);
            string content = response.Content;
            return content;
        }
    }
}

The XML returned is:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<r:ResourceReference xmlns="http://api.callfire.com/data" xmlns:r="http://api.callfire.com/resource">

   <r:Id>3552131003</r:Id>

<r:Location>https://www.callfire.com/api/1.1/rest/text/auto-reply/3552131003</r:Location>

</r:ResourceReference>

Have more questions? Submit a request

Comments