API Reference

The CallFire Developers API V2 is built from the ground up as a REST API. Easy to understand resource URLs, more features and functionality, and adherence to industry practices makes the CallFire API V2 better. Using many HTTP standards and features, the API can be consumed by any HTTP client, and no 3rd party SDKs are required. JSON responses will be returned from all API endpoints.

For a detailed look into our API check out our Swagger JSON

Are you still using CallFire API v1.1
Don't worry, the API documentation is still available here

API Endpoint

https://api.callfire.com/v2

Authentication

The CallFire API v2 uses HTTP Basic Authentication to verify the user of an endpoint. You can generate a username/password API credential on API access page. To use HTTP Basic Authentication, an Authorization header must be sent.

Example of generated API credentials

Username: a6343cc4edd6
Password: c2d77eec4aa3e224

The header that the user sends will look like:

Authorization: Basic a6343cc4edd6:c2d77eec4aa3e224

That is all that is needed to authenticate to the CallFire API. Read more about security on our LEARN pages.

Example Header

Authorization: Basic sendtexts:andcalls

Methods

The CallFire Developers API uses general HTTP verbs for its methods. GET, PUT, DELETE, POST are the default methods used in the CallFire API. Multiple forms of input are used to interact with the API. These methods are detailed in the Parameter Definitions panel to the side.

One special feature of the CallFire API is the fields parameter. Send this parameter on any endpoint to limit the data returned in the response. Use fields=id,name to only return id and name in the response. Use fields=items(id,name) to only return id and name in each object in a list named items.

Basic authentication is required for all endpoints. With CallFire Developers credentials, the HTTP header "Authorization: username:password" should be sent with all requests.

For most endpoints, the HTTP header "Content-Type: application/json" is required to produce the desired response.

Parameter Definitions

  • Path
    Where the parameter value is actually part of the operation's URL. For example, in /items/{itemId}, the path parameter is itemId.
  • Query
    Parameters that are appended to the URL. For example, in /items?id=###, the query parameter is id.
  • Body
    The payload that's appended to the HTTP request. Since there can only be one payload, there can only be one body parameter. The name of the body parameter has no effect on the parameter itself and is used for documentation purposes only. Since Form parameters are also in the payload, body and form parameters cannot exist together for the same operation.
  • Form / FormData
    Used to describe the payload of an HTTP request when either application/x-www-form-urlencoded or multipart/form-data are used as the content type of the request. This is the only parameter type that can be used to send files.

Errors

The CallFire Developers API uses standard HTTP response codes for responses. These HTTP codes indicate whether or not an API operation is successful.

Status Code 200 is the desired response code. A standard JSON response will follow.

Codes in the 400s range detail all of the errors a CallFire Developer could encounter while using the API. Bad Request, Rate Limit Reached, and Unauthorized are some of the sorts of responses in the 400s block.

Codes in the 500s range are error responses from the CallFire system. If an error has occured anywhere in the execution of a resource that was not due to user input, a 500 response will be returned with a corresponding JSON error body. In that body will contain a message detailing what went wrong.

HTTP Status Codes

  • 200
    OK - Everything went as planned
  • 204
    NO CONTENT - Request fulfilled, but no body
  • 400
    BAD REQUEST - The request was formatted improperly
  • 401
    UNAUTHORIZED - API Key missing or invalid
  • 403
    FORBIDDEN - Insufficient permissions
  • 404
    NOT FOUND - The resource requested does not exist
  • 500
    INTERNAL ERROR - We had an error! Sorry about that.

Partial Response

Another way to improve the performance of your API calls is by receiving only the portion of the data that you're interested in. This lets your application avoid transferring, parsing, and storing unneeded fields, so it can use resources including network, CPU, and memory more efficiently.

By default, the server sends back the full representation of a resource after processing requests. For better performance, you can ask the server to send only the fields you really need and get a partial response instead. To request a partial response, use the fields request parameter to specify the fields you want returned. You can use this parameter with almost all requests that return response data.

Fields parameter syntax

The format of the fields request parameter value is loosely based on XPath syntax. The supported syntax is summarized below:

  • Use a comma-separated list to select multiple fields.
  • Use a/b to select a field b that is nested within field a; use a/b/c to select a field c nested within b.
  • Use a sub-selector to request a set of specific sub-fields of arrays or objects by placing expressions in parentheses "( )". For example: fields=items(id,contact/first_name) returns only the item ID and contact's first name for each element in the items array. You can also specify a single sub-field, where fields=items(id) is equivalent to fields=items/id.
  • Fields parameter supports exclusion, use ! to exclude necessary fields, example fields=!a,b(d) will exclude any field list
  • If fields=! then exclude all fields from response.

Example Request

#!/usr/bin/env bash

# sample shows how fields parameter can be applied to operation which returns a paginated list. In this case API will return only following fields:
#  - totalCount,
#  - items.id,
#  - items.fromNumber,
#  - items.created,
#  - items.message,
#  - items.contact.id. See how response will look like below.

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/texts?fields=totalCount,items(id,fromNumber,created,message,contact/id)"

Example Response

{
  "items": [
    {
      "id": 13405,
      "fromNumber": "12135551100",
      "created": 1443382358000,
      "message": "a new test message",
      "contact": {
        "id": 898189497003
      }
    },
    {
      "id": 13404,
      "fromNumber": "12135551102",
      "created": 1443382248000,
      "message": "a new test message",
      "contact": {
        "id": 895559497003
      }
    }
  ],
  "totalCount": 3605
}

Send calls post

Use the /calls API to send individual calls quickly. A verified Caller ID and sufficient credits are required to make a call. CallRecipient represents a single recipient identified by phone number or contact id in CallFire system. You can attach user-defined attributes to a Call action via CallRecipient.attributes property, attributes are available in Call action response

path

  • https://api.callfire.com/v2/calls POST

parameters

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

  • campaignId integer

    Specifies a campaignId to send calls quickly on a previously created campaign

  • defaultLiveMessage string

    Text to be turned into a sound, this text will be played when the phone is answered. Parameter can be overridden for any particular CallRecipient

  • defaultMachineMessage string

    Text to be turned into a sound, this text will be played when answering machine is detected. Parameter can be overridden for any particular CallRecipient

  • defaultLiveMessageSoundId integer

    Id of sound file to play if phone is answered. Parameter can be overridden for any particular CallRecipient

  • defaultMachineMessageSoundId integer

    An id of a sound file to play if answering machine is detected. Parameter can be overridden for any particular CallRecipient

  • defaultVoice string

    The voice set by default for all text-to-speech messages defined in CallRecipient objects or as default *Message properties

  • body {...} list of ref

    List of CallRecipient

  • attributes object

    Map of user-defined string attributes associated with recipient

  • contactId integer

    An id of existing contact used as recipient

  • dialplanXml string

    An IVR xml document describing dialplan to setup an IVR broadcast. If dialplan is set there is no need to set live, machine and transfer sounds (or vice versa)

  • liveMessage string

    Text to be turned into a sound, this text will be played when the phone is answered

  • liveMessageSoundId integer

    An id of a sound file to play if phone is answered

  • machineMessage string

    Text to be used to turn into sound, this text will be played when answering machine is detected

  • machineMessageSoundId integer

    An id of a sound file to play if answering machine is detected

  • phoneNumber string

    Recipient's phone number in E.164 format (11-digit) or short code. Example: 12132000384

  • transferDigit string

    A digit pressed to initiate the transfer

  • transferMessage string

    Text to be turned into sound, this text will be played when the transfer digit is played

  • transferMessageSoundId integer

    An id of a sound file to play if call is transferred

  • transferNumber string

    Phone number in E.164 format (11-digit) to transfer the call to. Example: 12132000384

  • voice string

    The voice to be used (MALE1, FEMALE1, FEMALE2, SPANISH1, FRENCHCANADIAN1)

Sample Code

              
                
              
          

Sample Code

              
                

tbd

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.callstexts.model.Call; import com.callfire.api.client.api.callstexts.model.CallRecipient;

import java.util.Arrays; import java.util.List;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); //Only "recipients" param required CallRecipient r1 = new CallRecipient(); r1.setPhoneNumber("12132609784"); r1.setLiveMessage("Hello"); r1.setTransferMessage("transferTestMessage"); //or you can use transfer sound id r1.setTransferMessageSoundId(1123123L); r1.setTransferNumber("14246525473"); r1.setTransferDigit("1"); List recipients = Arrays.asList(r1); List calls = client.callsApi().send(recipients); // In case you want to send call via existing campaign provide campaign id as second parameter for send() method // calls = client.callsApi().send(Arrays.asList(recipient), 60000000003L); } }

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.CallsTexts.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var recipient1 = new CallRecipient { ContactId = 463633187003, LiveMessage = "testMessage", TransferDigit = "1", TransferMessage = "transferTestMessage", TransferNumber = "14246525473" }; var recipient2 = new CallRecipient { ContactId = 463633187003, LiveMessage = "test Message2", TransferDigit = "1", TransferMessageSoundId = 1, TransferNumber = "14246525473" }; var recipients = new List {recipient1, recipient2}; IList calls = client.CallsApi.Send(recipients); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST -d ' [ { "phoneNumber":"12135551100", "liveMessage":"Why hello there!" }, { "phoneNumber":"12135551101", "liveMessage":"And hello to you too." } ]' "https://api.callfire.com/v2/calls"

Example Response

                    
                      

{ "items": [ { "id": 13394, "fromNumber": "12135551189", "toNumber": "12135551100", "state": "READY", "campaignId": 10, "batchId": 6, "contact": { "id": 4096, "homePhone": "12135551100" }, "inbound": false, "created": 1443373382000, "modified": 1443373382000, "agentCall": false }, { "id": 13395, "fromNumber": "12135551189", "toNumber": "12135551101", "state": "READY", "campaignId": 10, "batchId": 6, "contact": { "id": 4097, "homePhone": "12135551101" }, "inbound": false, "created": 1443373386000, "modified": 1443373386000, "agentCall": false } ] }

Find calls get

To search for all calls sent or received by the user. Use "id=0" for the campaignId parameter to query for all calls sent through the POST /calls API. See call states and results

path

  • https://api.callfire.com/v2/calls GET

parameters

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

  • limit integer

    To set the maximum number of records to return in a paged list response. The default is 100

  • offset integer

    Offset to the start of a given page. The default is 0. Check [pagination](https://developers.callfire.com/docs.html#pagination) page for more information about pagination in CallFire API.

  • id array

    Lists the Call ids to search for. If calls ids are specified then other query parameters can be ignored

  • campaignId integer

    An id of a campaign, queries for calls included to a particular campaign. Specify null for all campaigns and 0 for default campaign

  • batchId integer

    An id of a contact batch, queries for calls of a particular contact batch

  • fromNumber string

    Phone number in E.164 format (11-digit) that call was from. Example: 12132000384

  • toNumber string

    Phone number in E.164 format (11-digit) that call was sent to. Example: 12132000384

  • label string

    A label for a specific call

  • states string

    Searches for all calls which correspond to statuses listed in a comma separated string. Available values: READY, SELECTED, CALLBACK, FINISHED, DISABLED, DNC, DUP, INVALID, TIMEOUT, PERIOD_LIMIT. See [call states and results](https://developers.callfire.com/results-responses-errors.html)

  • results string

    Searches for all calls with statuses listed in a comma separated string. Available values: SENT, RECEIVED, DNT, TOO_BIG, INTERNAL_ERROR, CARRIER_ERROR, CARRIER_TEMP_ERROR, UNDIALED. See [call states and results](https://developers.callfire.com/results-responses-errors.html)

  • inbound boolean

    Filters inbound calls for "true" value and outbound calls for "false" value

  • intervalBegin integer

    Start of the find time interval, formatted in unix time milliseconds. Example: 1473781817000 for Sat, 05 Jan 1985 14:03:37 GMT

  • intervalEnd integer

    End of the find time interval, formatted in unix time milliseconds. Example: 1473781817000 for Sat, 05 Jan 1985 14:03:37 GMT

Sample Code

              
                
              
          

Sample Code

              
                

tbd

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.callstexts.model.Call; import com.callfire.api.client.api.callstexts.model.request.FindCallsRequest; import com.callfire.api.client.api.common.model.Page;

import java.util.Arrays;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); // find all calls made through particular campaign, with exact toNumber and fromNumber FindCallsRequest request = FindCallsRequest.create() .id(Arrays.asList(617067920003L)) .campaignId(7373801003L) .fromNumber("12132609784") .toNumber("12132212384") .build(); Page calls = client.callsApi().find(request); // check Call.records.questionResponses list for stored data } }

Sample Code

              
                

using System; using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.CallsTexts.Model; using CallfireApiClient.Api.CallsTexts.Model.Request; using CallfireApiClient.Api.Common.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password");

    var request = new FindCallsRequest
    {
        States = new List<StateType> {StateType.FINISHED, StateType.READY},
        IntervalBegin = DateTime.UtcNow.AddMonths(-2),
        IntervalEnd = DateTime.UtcNow,
        Limit = 3
    };
    Page<Call> calls = client.CallsApi.Find(request);
    // check Call.records.questionResponses for stored data
}

}

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/calls?limit=2"

Example Response

                    
                      

{ "items": [ { "id": 13395, "fromNumber": "12135551189", "toNumber": "12135551101", "state": "FINISHED", "campaignId": 10, "batchId": 6, "contact": { "id": 4097, "homePhone": "12135551101" }, "labels": [ "survey 1" ], "attributes": { "external_user_id":"45450007002", "external_route_id":"77770007002" }, "inbound": false, "created": 1443373386000, "modified": 1443373412000, "finalCallResult": "LA", "records": [ { "id": 10306, "billedAmount": 1.1667, "finishTime": 1443373425000, "callResult": "LA", "questionResponses":[
{
"question":"Do you have a dog", "response":"Yes" }, {
"question":"What's your favorite movie", "response":"StarWars" } ] } ], "agentCall": false }, { "id": 13394, "fromNumber": "12135551189", "toNumber": "12135551100", "state": "FINISHED", "campaignId": 10, "batchId": 6, "contact": { "id": 4096, "homePhone": "12135551100" }, "inbound": false, "created": 1443373382000, "modified": 1443373412000, "finalCallResult": "CARRIER_ERROR", "records": [ { "id": 10305, "billedAmount": 0, "finishTime": 1443373408000, "callResult": "CARRIER_ERROR" } ], "agentCall": false } ], "limit": 2, "offset": 0, "totalCount": 7160 }

Create a call broadcast post

Creates a call broadcast campaign using the Call Broadcast API. Send a CallBroadcast in the message body to add details in a voice broadcast campaign. The campaign can be created without contacts and bare minimum configuration, but contacts will have to be added further on to use the campaign

path

  • https://api.callfire.com/v2/calls/broadcasts POST

parameters

  • start boolean

    Specify whether to immediately start this campaign (not required)

  • body {...} ref

    CallBroadcast

  • answeringMachineConfig string

    Specifies which action should be taken if answering machine was detected, default value: AM_AND_LIVE. Available values: AM_ONLY - run AMD (Answering Machine Detection), hang up if LA (Live Answer); AM_AND_LIVE - run AMD, play separate live vs. machine sound; LIVE_WITH_AMD, run AMD, hang up if machine answers; LIVE_IMMEDIATE - no AMD, play live sound immediately

  • dialplanXml string

    IVR xml is a document which describes the dialplan to setup the IVR broadcast

  • fromNumber string

    Phone number in E.164 format (11-digit) or short code for text. Example: 12132000384, 67076

  • id integer

    A unique id of broadcast (readonly)

  • labels array

    Labels of a broadcast

  • lastModified integer

    The time when a given resource was updated, formatted in unix time milliseconds (read only). Example: 1473781817000 for Sat, 05 Jan 1985 14:03:37 GMT

  • localTimeRestriction ref

    Specifies a range of time during which Callfire will send a call or text to recipients. Please note that range of time applies to the recipient's timezone

  • maxActive integer

    Sets a maximum number of calls to be dialed by Callfire at once

  • maxActiveTransfers integer

    A maximum number of active transfers

  • name string

    A name of a broadcast

  • recipients array

    Recipients of a call broadcast, can be either existing contacts or a new ones

  • resumeNextDay boolean

    If true resumes the unfinished campaign to the next day

  • retryConfig ref

    Retry configuration allows system to retry the numbers which were not reached the first time. Designate the number of retries, the length between them, and which dispositions you want to retry

  • schedules array

    A list of schedule objects which specifies a range of time when broadcast should be started and stopped. Supports the scheduling per day of week

  • sounds ref

    A set of sounds assigned to a voice broadcast to play depending on answering machine configuration

  • status string

    A status of a broadcast (read only). SETUP - campaign isn't configured yet; START_PENDING - waiting for contact batch population; RUNNING - campaign is running; STOPPED - campaign is stopped; FINISHED - campaign is finished; ARCHIVED - campaign was archived

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.AnsweringMachineConfig; import com.callfire.api.client.api.campaigns.model.CallBroadcast; import com.callfire.api.client.api.campaigns.model.CallBroadcastSounds; import com.callfire.api.client.api.campaigns.model.DayOfWeek; import com.callfire.api.client.api.campaigns.model.LocalDate; import com.callfire.api.client.api.campaigns.model.LocalTime; import com.callfire.api.client.api.campaigns.model.LocalTimeRestriction; import com.callfire.api.client.api.campaigns.model.Recipient; import com.callfire.api.client.api.campaigns.model.RetryConfig; import com.callfire.api.client.api.campaigns.model.RetryConfig.RetryPhoneTypes; import com.callfire.api.client.api.campaigns.model.RetryConfig.RetryResults; import com.callfire.api.client.api.campaigns.model.Schedule; import com.callfire.api.client.api.campaigns.model.Voice; import com.callfire.api.client.api.common.model.ResourceId;

import java.util.Arrays; import java.util.HashSet;

/**

  • Example shows how to schedule a voice broadcast in a single call
  • and send a voice message to 3 recipients */ class CreateVoiceBroadcastSample {

    public static void main(String[] args) {

     CallfireClient client = new CallfireClient("api_login", "api_password");
     CallBroadcast broadcast = new CallBroadcast();
     broadcast.setName("Charity Campaign");
     // attach custom labels if needed
     broadcast.setLabels(Arrays.asList("charity", "id-10002"));
     // set validated Caller ID number. 
     broadcast.setFromNumber("12135551189");
     // set answering machine detection
     broadcast.setAnsweringMachineConfig(AnsweringMachineConfig.AM_AND_LIVE);
    
     // set voice messages using TTS option for Live answers and when Answering Machine is detected.
     // you also can set a pre-defined TTS voice.
     CallBroadcastSounds sounds = new CallBroadcastSounds();
     sounds.setLiveSoundText("Hello, this is Mary, from the local branch of Non-profit agency." +
         "Don't miss our charity weekend taking place at first November weekends. We are " +
         "looking forward to meet you there. Press '1' to to find out more details.");
     sounds.setLiveSoundTextVoice(Voice.MALE1);
     sounds.setMachineSoundText("Hello, this is Mary, from the local branch of Non-profit agency." +
         "If you are interested in charity weekend, please call (231) 455-7676.");
     sounds.setMachineSoundTextVoice(Voice.MALE1);
     sounds.setTransferDigit("1");
     // set number to transfer call to once transfer digit is pressed
     sounds.setTransferNumber("12314557676");
     sounds.setTransferSoundText("Please wait a moment, call is being transfer.");
     broadcast.setSounds(sounds);
    
     // allow CallFire to dial recipient only between 09:00 - 18:00 depending on
     //  recipient's number area code timezone
     LocalTimeRestriction timeRestriction = new LocalTimeRestriction();
     timeRestriction.setBeginHour(9);
     timeRestriction.setBeginMinute(0);
     timeRestriction.setEndHour(18);
     timeRestriction.setEndMinute(0);
     broadcast.setLocalTimeRestriction(timeRestriction);
    
     // set retry configuration to attempt a contact's Mobile and Work phone numbers twice in case Call was 
     //  resulted to BUSY or No Answer response. Set 5 minutes between attempts.  
     RetryConfig retryConfig = new RetryConfig();
     retryConfig.setMaxAttempts(2);
     retryConfig.setMinutesBetweenAttempts(5);
     retryConfig.setRetryResults(Arrays.asList(RetryResults.BUSY, RetryResults.NO_ANS));
     retryConfig.setRetryPhoneTypes(Arrays.asList(RetryPhoneTypes.MOBILE_PHONE, RetryPhoneTypes.WORK_PHONE));
     broadcast.setRetryConfig(retryConfig);
    
     // schedule a campaign to run on every Monday and Wednesday starting from 2016-12-01 10:00:00 
     Schedule schedule = new Schedule();
     schedule.setStartDate(new LocalDate(2016, 12, 1));
     schedule.setStartTimeOfDay(new LocalTime(10, 0, 0));
     // set weekly schedule
     schedule.setDaysOfWeek(new HashSet<>(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.WEDNESDAY)));
     // set optional time zone, if leave empty account's timezone will be used 
     schedule.setTimeZone("America/New_York");
     broadcast.setSchedules(Arrays.asList(schedule));
    
     // add new recipients
     Recipient recipient1 = new Recipient();
     recipient1.setPhoneNumber("12135551100");
     // set custom recipient attributes, they are available only to a single Call/Text
     //  action, do not confuse them with contact fields which are stored with contact and are available to
     //  each Call/Text where contact is attached to
     recipient1.getAttributes().put("age", "30");
     recipient1.getAttributes().put("position", "Manager");
    
     Recipient recipient2 = new Recipient();
     recipient2.setPhoneNumber("12135551101");
     recipient2.getAttributes().put("external_system_id", "34347770001");
     recipient2.getAttributes().put("call_label", "friends");
    
     // You can use already existing contacts as a recipients
     Recipient recipient3 = new Recipient();
     recipient3.setContactId(46000044001L);
    
     broadcast.setRecipients(Arrays.asList(recipient1, recipient2, recipient3));
    
     // create broadcast with 'start' argument = true to start campaign immediately
     ResourceId id = client.callBroadcastsApi().create(broadcast, false);
    
     System.out.println(id);

    } }

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.Campaigns.Model; using DayOfWeek = CallfireApiClient.Api.Campaigns.Model.DayOfWeek;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var broadcast = new CallBroadcast { Name = "Charity Campaign", // set validated Caller ID number. FromNumber = "12135551189", // attach custom labels if needed Labels = new List {"charity", "id-10002"}, // set answering machine detection AnsweringMachineConfig = AnsweringMachineConfig.AM_AND_LIVE, // set voice messages using TTS option for Live answers and when Answering Machine is detected. // you also can set a pre-defined TTS voice. Sounds = new CallBroadcastSounds { LiveSoundText = "Hello, this is Mary, from the local branch of Non-profit agency. " + "Do not miss our charity weekend taking place at first November weekends." + " We are looking forward to meet you there. Press '1' to to find out more details.", LiveSoundTextVoice = Voice.MALE1, MachineSoundText = "Hello, this is Mary, from the local branch of Non-profit agency. " + "If you are interested in charity weekend, please call (231) 455-7676.", MachineSoundTextVoice = Voice.MALE1, TransferSoundText = "Please wait a moment, call is being transfer.", // set number to transfer call to once transfer digit is pressed TransferDigit = "1", TransferNumber = "12314557676" }, // allow CallFire to dial recipient only between 09:00 - 18:00 depending on // recipient's number area code timezone LocalTimeRestriction = new LocalTimeRestriction { BeginHour = 9, BeginMinute = 0, EndHour = 18, EndMinute = 0 }, // schedule a campaign to run on every Monday and Wednesday starting from 2016-12-01 10:00:00 Schedules = new List { new Schedule { StartDate = new LocalDate {Year = 2016, Month = 12, Day = 1}, StartTimeOfDay = new LocalTime {Hour = 10, Minute = 0, Second = 0}, // set weekly schedule DaysOfWeek = new HashSet {DayOfWeek.MONDAY, DayOfWeek.WEDNESDAY}, // set optional time zone, if leave empty account's timezone will be used TimeZone = "America/New_York" } }, // set retry configuration to attempt a contact's Mobile and Work phone numbers twice in case Call was // resulted to BUSY or No Answer response. Set 5 minutes between attempts. RetryConfig = new RetryConfig { MaxAttempts = 2, MinutesBetweenAttempts = 5, RetryResults = new List {RetryResults.BUSY, RetryResults.NO_ANS}, RetryPhoneTypes = new List { RetryPhoneTypes.MOBILE_PHONE, RetryPhoneTypes.WORK_PHONE } }, // add new recipients Recipients = new List { new Recipient { PhoneNumber = "12135551100", // set custom recipient attributes, they are available only to a single Call/Text // action, do not confuse them with contact fields which are stored with contact // and are available to each Call/Text where contact is attached to Attributes = new Dictionary { {"age", "30"}, {"position", "Manager"} } }, new Recipient { PhoneNumber = "12135551101", Attributes = new Dictionary { {"external_system_id", "34347770001"}, {"call_label", "friends"} } }, // You can use already existing contacts as a recipients new Recipient { ContactId = 46000044001 } } };

    // create broadcast with 'start' argument = true to start campaign immediately
    var id = client.CallBroadcastsApi.Create(broadcast, false);
}

}

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST -d ' { "name":"Example API Call Broadcast", "fromNumber":"12135551189", "recipients":[ { "phoneNumber":"2135551133" } ], "answeringMachineConfig":"AM_AND_LIVE", "sounds":{ "liveSoundText":"Hello! This is a live answer text to speech recording", "machineSoundText":"This is an answering machine text to speech recording" }, "resumeNextDay":"true" }' "https://api.callfire.com/v2/calls/broadcasts"

Example Response

                    
                      

{ "id": 15 }

Find call broadcasts get

Searches for all voice broadcasts created by user. Can query on label, name, and the current running status of the campaign. Returns a paged list of voice broadcasts

path

  • https://api.callfire.com/v2/calls/broadcasts GET

parameters

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

  • limit integer

    To set the maximum number of records to return in a paged list response. The default is 100

  • offset integer

    Offset to the start of a given page. The default is 0. Check [pagination](https://developers.callfire.com/docs.html#pagination) page for more information about pagination in CallFire API.

  • label string

    A label of a voice broadcast

  • name string

    A name of voice broadcast

  • running boolean

    Specify whether the campaigns should be running or not

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.CallBroadcast; import com.callfire.api.client.api.campaigns.model.request.FindCallBroadcastsRequest; import com.callfire.api.client.api.common.model.Page;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); FindCallBroadcastsRequest request = FindCallBroadcastsRequest.create() // find all call broadcasts which name like 'campaign' .name("campaign") .limit(2L) .build(); Page broadcasts = client.callBroadcastsApi().find(request); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Campaigns.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password");

    var findRequest = new FindBroadcastsRequest
    {
        Name = "campaign name",
        Limit = 2
    };
    var broadcasts = client.CallBroadcastsApi.Find(findRequest);
}

}

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/calls/broadcasts?name=Example+API+Call+Broadcast"

Example Response

                    
                      

{ "items": [ { "id": 14, "name": "Example API VB", "status": "STOPPED", "lastModified": 1443382636000, "fromNumber": "12135551189", "localTimeRestriction": { "enabled": false }, "retryConfig": { "maxAttempts": 1, "minutesBetweenAttempts": 60, "retryPhoneTypes": [ "FIRST_NUMBER" ] }, "resumeNextDay": true, "answeringMachineConfig": "AM_AND_LIVE", "sounds": { "liveSoundText": "Hello! This is a live answer text to speech recording", "liveSoundId": 64, "machineSoundText": "This is an answering machine text to speech recording", "machineSoundId": 65 } } ], "totalCount": 1 }

Find a specific call broadcast get

Returns a single CallBroadcast instance for a given call broadcast campaign id

path

  • https://api.callfire.com/v2/calls/broadcasts/{id} GET

parameters

  • id integer required

    An id of a CallBroadcast

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.CallBroadcast;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); CallBroadcast broadcast = client.callBroadcastsApi().get(123L); } }

Sample Code

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var broadcast = client.CallBroadcastsApi.Get(123L); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/calls/broadcasts/15"

Example Response

                    
                      

{ "id": 11, "name": "Example API Call Broadcast", "status": "STOPPED", "lastModified": 1455240858000, "fromNumber": "12135551189", "localTimeRestriction": { "enabled": false }, "retryConfig": { "maxAttempts": 1, "minutesBetweenAttempts": 60, "retryPhoneTypes": [ "FIRST_NUMBER" ] }, "resumeNextDay": true, "sounds": { "liveSoundText": "Hello! This is a live answer text to speech recording", "liveSoundId": 75, "machineSoundText": "This is an answering machine text to speech recording", "machineSoundId": 76 }, "answeringMachineConfig": "AM_AND_LIVE" }

Update a call broadcast put

This operation lets the user modify the configuration of a voice broadcast campaign after call broadcast campaign is created. See CallBroadcast for more information on what can/can't be updated on this API

path

  • https://api.callfire.com/v2/calls/broadcasts/{id} PUT

parameters

  • id integer required

    An id of a voice broadcast

  • body {...} ref

    CallBroadcast

  • answeringMachineConfig string

    Specifies which action should be taken if answering machine was detected, default value: AM_AND_LIVE. Available values: AM_ONLY - run AMD (Answering Machine Detection), hang up if LA (Live Answer); AM_AND_LIVE - run AMD, play separate live vs. machine sound; LIVE_WITH_AMD, run AMD, hang up if machine answers; LIVE_IMMEDIATE - no AMD, play live sound immediately

  • dialplanXml string

    IVR xml is a document which describes the dialplan to setup the IVR broadcast

  • fromNumber string

    Phone number in E.164 format (11-digit) or short code for text. Example: 12132000384, 67076

  • id integer

    A unique id of broadcast (readonly)

  • labels array

    Labels of a broadcast

  • lastModified integer

    The time when a given resource was updated, formatted in unix time milliseconds (read only). Example: 1473781817000 for Sat, 05 Jan 1985 14:03:37 GMT

  • localTimeRestriction ref

    Specifies a range of time during which Callfire will send a call or text to recipients. Please note that range of time applies to the recipient's timezone

  • maxActive integer

    Sets a maximum number of calls to be dialed by Callfire at once

  • maxActiveTransfers integer

    A maximum number of active transfers

  • name string

    A name of a broadcast

  • recipients array

    Recipients of a call broadcast, can be either existing contacts or a new ones

  • resumeNextDay boolean

    If true resumes the unfinished campaign to the next day

  • retryConfig ref

    Retry configuration allows system to retry the numbers which were not reached the first time. Designate the number of retries, the length between them, and which dispositions you want to retry

  • schedules array

    A list of schedule objects which specifies a range of time when broadcast should be started and stopped. Supports the scheduling per day of week

  • sounds ref

    A set of sounds assigned to a voice broadcast to play depending on answering machine configuration

  • status string

    A status of a broadcast (read only). SETUP - campaign isn't configured yet; START_PENDING - waiting for contact batch population; RUNNING - campaign is running; STOPPED - campaign is stopped; FINISHED - campaign is finished; ARCHIVED - campaign was archived

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.CallBroadcast; import com.callfire.api.client.api.campaigns.model.DayOfWeek; import com.callfire.api.client.api.campaigns.model.LocalDate; import com.callfire.api.client.api.campaigns.model.LocalTime; import com.callfire.api.client.api.campaigns.model.LocalTimeRestriction; import com.callfire.api.client.api.campaigns.model.Schedule;

import java.util.Arrays; import java.util.HashSet;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); CallBroadcast broadcast = client.callBroadcastsApi().get(123L); // time restrictions LocalTimeRestriction restrictions = new LocalTimeRestriction(); restrictions.setBeginHour(10); restrictions.setBeginMinute(10); restrictions.setEndHour(22); restrictions.setEndMinute(0); restrictions.setEnabled(true);

    // add schedule to a campaign to run on Saturday and Sunday between 2016-12-01 10:00:00
    //  and 2016-12-10 18:00:00
    Schedule schedule = new Schedule();
    schedule.setStartDate(new LocalDate(2016, 12, 1));
    schedule.setStartTimeOfDay(new LocalTime(10, 0, 0));
    schedule.setStopDate(new LocalDate(2016, 12, 10));
    schedule.setStopTimeOfDay(new LocalTime(18, 0, 0));
    schedule.setDaysOfWeek(new HashSet<>(Arrays.asList(DayOfWeek.SATURDAY, DayOfWeek.SUNDAY)));
    // set optional time zone, if leave empty account's timezone will be used
    schedule.setTimeZone("America/New_York");

    broadcast.setLocalTimeRestriction(restrictions);
    broadcast.getSchedules().add(schedule);
    // update campaign
    client.callBroadcastsApi().update(broadcast);
}

}

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.Campaigns.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var broadcast = client.CallBroadcastsApi.Get(123L); // time restrictions broadcast.LocalTimeRestriction = new LocalTimeRestriction { BeginHour = 10, BeginMinute = 10, EndHour = 22, EndMinute = 0, Enabled = true }; broadcast.Schedules.Add( // schedule a campaign to run on Saturday and Sunday between 2016-12-01 10:00:00 // and 2016-12-10 18:00:00 new Schedule { StartDate = new LocalDate {Year = 2016, Month = 12, Day = 1}, StartTimeOfDay = new LocalTime {Hour = 10, Minute = 0, Second = 0}, StopDate = new LocalDate {Year = 2016, Month = 12, Day = 10}, StopTimeOfDay = new LocalTime {Hour = 18, Minute = 0, Second = 0}, // set weekly schedule DaysOfWeek = new HashSet {DayOfWeek.SATURDAY, DayOfWeek.SUNDAY}, // set optional time zone, if leave empty account's timezone will be used TimeZone = "America/New_York" }); // update campaign client.CallBroadcastsApi.Update(broadcast); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X PUT -d ' { "name":"Call Broadcast with Schedules", "answeringMachineConfig":"LIVE_IMMEDIATE", "sounds": { "liveSoundText":"Hello! This is an updated Call Broadcast config tts" }, "schedules": [ { "startTimeOfDay": { "hour": 10, "minute": 0, "second": 0 }, "stopTimeOfDay": { "hour": 18, "minute": 0, "second": 0 }, "daysOfWeek": [ "SATURDAY", "SUNDAY" ], "timeZone": "America/New_York", "startDate": { "year": 2016, "month": 12, "day": 1 }, "stopDate": { "year": 2016, "month": 12, "day": 10 } }] }' "https://api.callfire.com/v2/calls/broadcasts/15"

Example Response

                    
                      

200 OK - No Response

Archive voice broadcast post

Archives a voice broadcast (voice broadcast will be hidden in search results)

path

  • https://api.callfire.com/v2/calls/broadcasts/{id}/archive POST

parameters

  • id integer required

    An id of a voice broadcast to archive

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("api_login", "api_password"); callfireClient.callBroadcastsApi().archive(123L); } }

Sample Code

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); client.CallBroadcastsApi.Archive(123L); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST "https://api.callfire.com/v2/calls/broadcasts/15/archive"

Example Response

                    
                      

200 OK - No Response

Add batches to a call broadcast post

The 'add batch' API allows user to add additional batches to an already created voice broadcast campaign. The added batch will go through the CallFire validation process, unlike in the recipients version of this API. That is why you can use the scrubDuplicates flag to remove duplicates from your batch. Batches may be added as a contact list id, a list of contact ids, or a list of numbers

path

  • https://api.callfire.com/v2/calls/broadcasts/{id}/batches POST

parameters

  • id integer required

    An id of a call broadcast

  • body {...} ref

    BatchRequest

  • contactListId integer

    An id of existing contact list

  • name string

    A name of batch

  • recipients array

    A list of Recipient objects. For each recipient you can set its phone number or existing contact id to use contact which already exists in account

  • scrubDuplicates boolean

    Removes duplicate recipients from batch if true

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.Recipient; import com.callfire.api.client.api.campaigns.model.request.AddBatchRequest; import com.callfire.api.client.api.common.model.ResourceId;

import java.util.Arrays;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("api_login", "api_password"); Recipient recipient1 = new Recipient(); recipient1.setPhoneNumber("12131234567"); Recipient recipient2 = new Recipient(); recipient2.setPhoneNumber("12131234568"); AddBatchRequest request = AddBatchRequest.create() .campaignId(123456L) .name("new_batch") .scrubDuplicates(true) .recipients(Arrays.asList(recipient1, recipient2)) .build(); ResourceId resourceId = callfireClient.callBroadcastsApi().addBatch(request); } }

Sample Code

              
                

using System.Collections.Generic; using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.Campaigns.Model; using CallfireApiClient.Api.Campaigns.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new AddBatchRequest { CampaignId = 1234, Name = "Contact Batch 1", Recipients = new List { new Recipient {PhoneNumber = "12131234567"}, new Recipient {PhoneNumber = "12131234568"} } }; var id = client.CallBroadcastsApi.AddBatch(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST -d ' { "name":"batch name", "recipients": [ { "phoneNumber":"12135551100" }, { "phoneNumber":"12135551101" } ] }' "https://api.callfire.com/v2/calls/broadcasts/15/batches"

Example Response

                    
                      

{ "id": 13 }

Find batches in a call broadcast get

This endpoint will enable the user to page through all of the batches for a particular voice broadcast campaign

path

  • https://api.callfire.com/v2/calls/broadcasts/{id}/batches GET

parameters

  • id integer required

    An id of a call broadcast

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

  • limit integer

    To set the maximum number of records to return in a paged list response. The default is 100

  • offset integer

    Offset to the start of a given page. The default is 0. Check [pagination](https://developers.callfire.com/docs.html#pagination) page for more information about pagination in CallFire API.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.Batch; import com.callfire.api.client.api.common.model.Page; import com.callfire.api.client.api.common.model.request.GetByIdRequest;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); GetByIdRequest request = GetByIdRequest.create() .id(1234L) .limit(10L) .build(); Page batches = client.callBroadcastsApi().getBatches(request); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Common.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new GetByIdRequest {Id = 1234}; var batches = client.CallBroadcastsApi.GetBatches(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/calls/broadcasts/15/batches"

Example Response

                    
                      

{ "items": [ { "id": 12, "name": "API 14", "status": "ACTIVE", "broadcastId": 14, "created": 1443382635000, "size": 1, "remaining": 1, "enabled": true }, { "id": 13, "name": "batch name", "status": "ACTIVE", "broadcastId": 14, "created": 1443383158000, "size": 2, "remaining": 2, "enabled": true } ], "limit": 100, "offset": 0 }

Find calls in a call broadcast get

This endpoint will enable the user to page through all calls for a particular call broadcast campaign

path

  • https://api.callfire.com/v2/calls/broadcasts/{id}/calls GET

parameters

  • id integer required

    An Id of a call broadcast

  • batchId integer

    An id of a particular batch associated with broadcast

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

  • limit integer

    To set the maximum number of records to return in a paged list response. The default is 100

  • offset integer

    Offset to the start of a given page. The default is 0. Check [pagination](https://developers.callfire.com/docs.html#pagination) page for more information about pagination in CallFire API.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.callstexts.model.Call; import com.callfire.api.client.api.campaigns.model.request.FindBroadcastCallsRequest; import com.callfire.api.client.api.common.model.Page;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); FindBroadcastCallsRequest request = FindBroadcastCallsRequest.create() .id(1234L) .build(); Page calls = client.callBroadcastsApi().findCalls(request); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Common.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new GetBroadcastCallsTextsRequest {Id = 1234, batchId = 12345}; var calls = client.CallBroadcastsApi.GetCalls(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/calls/broadcasts/15/calls"

Example Response

                    
                      

{ "items": [ { "id": 13408, "fromNumber": "12135551189", "toNumber": "12135551101", "state": "READY", "campaignId": 14, "batchId": 13, "contact": { "id": 4097, "homePhone": "12135551101" }, "inbound": false, "created": 1443383158000, "modified": 1443383158000, "agentCall": false }, { "id": 13407, "fromNumber": "12135551189", "toNumber": "12135551100", "state": "READY", "campaignId": 14, "batchId": 13, "contact": { "id": 4096, "homePhone": "12135551100" }, "inbound": false, "created": 1443383158000, "modified": 1443383158000, "agentCall": false }, { "id": 13406, "fromNumber": "12135551189", "toNumber": "12135551133", "state": "READY", "campaignId": 14, "batchId": 12, "contact": { "id": 4102, "homePhone": "2135551133" }, "inbound": false, "created": 1443382636000, "modified": 1443382636000, "agentCall": false } ], "limit": 100, "offset": 0, "totalCount": 3 }

Add recipients to a call broadcast post

Use this API to add the recipients to an existing voice broadcast. Post a list of Recipient objects to be added to the voice broadcast campaign. These contacts will not go through validation process, and will be acted upon as they are added. Recipients may be added as a list of contact ids, or list of numbers

path

  • https://api.callfire.com/v2/calls/broadcasts/{id}/recipients POST

parameters

  • id integer required

    An id of a call broadcast

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

  • body {...} list of ref

    List of Recipient

  • attributes object

    Map of user-defined string attributes associated with recipient

  • contactId integer

    An id of existing contact used as recipient

  • phoneNumber string

    A recipient's phone number in E.164 format (11-digit) or short code. Example: 12132000384, 67076

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.callstexts.model.Call; import com.callfire.api.client.api.campaigns.model.Recipient;

import java.util.Arrays; import java.util.List;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("api_login", "api_password"); Recipient recipient1 = new Recipient(); recipient1.setPhoneNumber("12131234567"); Recipient recipient2 = new Recipient(); recipient2.setPhoneNumber("12131234568"); List recipients = Arrays.asList(recipient1, recipient2); List calls = callfireClient.callBroadcastsApi().addRecipients(123456L, recipients); } }

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.Campaigns.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var calls = client.CallBroadcastsApi.AddRecipients(1234, new List { new Recipient {PhoneNumber = "12131234567"}, new Recipient {PhoneNumber = "12131234568"} }); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST -d ' [ { "phoneNumber":"12135551100" }, { "phoneNumber":"12135551101" } ]' "https://api.callfire.com/v2/calls/broadcasts/15/recipients"

Example Response

                    
                      

{ "items": [ { "id": 13410, "fromNumber": "12135551189", "toNumber": "12135551100", "state": "READY", "campaignId": 14, "batchId": 12, "contact": { "id": 4096, "homePhone": "12135551100" }, "inbound": false, "created": 1443383295000, "modified": 1443383295000, "agentCall": false }, { "id": 13411, "fromNumber": "12135551189", "toNumber": "12135551101", "state": "READY", "campaignId": 14, "batchId": 12, "contact": { "id": 4097, "homePhone": "12135551101" }, "inbound": false, "created": 1443383295000, "modified": 1443383295000, "agentCall": false } ] }

Start voice broadcast post

Start a voice broadcast

path

  • https://api.callfire.com/v2/calls/broadcasts/{id}/start POST

parameters

  • id integer required

    An id of voice broadcast to start

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); client.callBroadcastsApi().start(123L); } }

Sample Code

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); client.CallBroadcastsApi.Start(123L); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST "https://api.callfire.com/v2/calls/broadcasts/15/start"

Example Response

                    
                      

200 OK - No Response

Get statistics on call broadcast get

Returns broadcast statistics like total number of sent/received actions, total cost, number of remaining outbound actions, error count, etc

path

  • https://api.callfire.com/v2/calls/broadcasts/{id}/stats GET

parameters

  • id integer required

    An id of a call broadcast

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

  • begin integer

    Start of the search time interval, formatted in unix time milliseconds. Example: 1473781817000 for Sat, 05 Jan 1985 14:03:37 GMT

  • end integer

    End of the search time interval, formatted in unix time milliseconds. Example: 1473781817000 for Sat, 05 Jan 1985 14:03:37 GMT

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.CallBroadcastStats; import org.apache.commons.lang3.time.DateUtils;

import java.util.Date;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); Date end = new Date(); Date begin = DateUtils.addDays(end, -5); // limit returned fields if needed String fields = "callsAttempted,callsPlaced,callsDuration"; CallBroadcastStats stats = client.callBroadcastsApi().getStats(8624192003L, fields, begin, end); } }

Sample Code

              
                

using System; using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); // limit returned fields if needed var fields = "callsAttempted,callsPlaced,callsDuration"; var begin = DateTime.Now.AddDays(-5d); var end = DateTime.Now; var stats = client.CallBroadcastsApi.GetStats(8624192003L, fields, begin, end); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/calls/broadcasts/15/stats"

Example Response

                    
                      

{ "totalOutboundCount": 2, "remainingOutboundCount": 0, "billedAmount": 1.6667, "callsAttempted": 1, "callsPlaced": 1, "callsDuration": 1, "billedDuration": 60, "responseRatePercent": 100, "callsRemaining": 1, "callsAwaitingRedial": 0, "callsLiveAnswer": 1, "totalCount": 2, "answeringMachineCount": 0, "busyCount": 0, "dialedCount": 1, "doNotCallCount": 1, "errorCount": 0, "liveCount": 1, "miscCount": 0, "noAnswerCount": 0, "transferCount": 0 }

Stop voice broadcast post

Stop a voice broadcast

path

  • https://api.callfire.com/v2/calls/broadcasts/{id}/stop POST

parameters

  • id integer required

    An id of voice broadcast to stop

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); client.callBroadcastsApi().stop(123L); } }

Sample Code

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); client.CallBroadcastsApi.Stop(123L); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST "https://api.callfire.com/v2/calls/broadcasts/15/stop"

Example Response

                    
                      

200 OK - No Response

Get call recording by id get

Returns metadata of recording of a particular call. Metadata contains a link to a MP3 recording

path

  • https://api.callfire.com/v2/calls/recordings/{id} GET

parameters

  • id integer required

    ~

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.CallRecording;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); CallRecording rec = client.callsApi().getCallRecording(1234L, "campaignId"); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Campaigns.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); CallRecording rec = client.CallsApi.GetCallRecording(1234); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/calls/recordings/101"

Example Response

                    
                      

{ "id": 2033, "callId": 101, "campaignId": 15, "name": "hello", "created": 1443382635000, "lengthInBytes": 12345, "lengthInSeconds": 9, "hash": "", "mp3Url": "https://api.callfire.com/calls/recordings/2033", "state": "READY" }

Get call recording in mp3 format get

Returns an MP3 recording of particular call, response contains binary data, content type is 'audio/mpeg'

path

  • https://api.callfire.com/v2/calls/recordings/{id}.mp3 GET

parameters

  • id integer required

    An id of a call

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient;

import java.io.InputStream;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); InputStream is = client.callsApi().getCallRecordingMp3(1234L); } }

Sample Code

              
                

using System.IO; using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); Stream stream = client.CallsApi.GetCallRecordingMp3(1234); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/calls/recordings/101.mp3"

Example Response

                    
                      

mp3 binary file response

Find a specific call get

Returns a single Call instance for a given call id.

path

  • https://api.callfire.com/v2/calls/{id} GET

parameters

  • id integer required

    An id of a call

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.callstexts.model.Call;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); Call call = client.callsApi().get(617067920003L); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.CallsTexts.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); // limit returned fields if needed Call call = client.CallsApi.Get(617067920003, "id,toNumber,state"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/calls/13393"

Example Response

                    
                      

{ "id": 13393, "fromNumber": "12135551189", "toNumber": "12135551101", "state": "FINISHED", "campaignId": 10, "batchId": 6, "contact": { "id": 4097, "homePhone": "12135551101" }, "inbound": false, "created": 1443333911000, "modified": 1443333978000, "finalCallResult": "LA", "records": [ { "id": 10304, "billedAmount": 1.1667, "finishTime": 1443333972000, "callResult": "LA" } ], "agentCall": false }

Get call recordings for a call get

Returns a list of recordings metadata of particular call. Metadata contains link to a MP3 recording

path

  • https://api.callfire.com/v2/calls/{id}/recordings GET

parameters

  • id integer required

    An id of a call

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.CallRecording;

import java.util.List;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); List recs = client.callsApi().getCallRecordings(1232L, "items(callId)"); } }

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.Campaigns.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); // limit returned fields if needed IList recordings = client.CallsApi.GetCallRecordings(1234, "items(callId)"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/calls/15/recordings"

Example Response

                    
                      

{ "items": [ { "id": 2033, "callId": 101, "campaignId": 15, "name": "hello", "created": 1443382635000, "lengthInBytes": 12345, "lengthInSeconds": 9, "hash": "", "mp3Url": "https://api.callfire.com/calls/recordings/2033", "state": "READY" } ] }

Get call recording by name get

Returns recording metadata of particular call. Metadata contains link to a MP3 recording

path

  • https://api.callfire.com/v2/calls/{id}/recordings/{name} GET

parameters

  • id integer required

    An id of a call

  • name string required

    A name of a recording

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.CallRecording;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); CallRecording recording = client.callsApi().getCallRecordingByName(1234L, "testName", "callId"); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Campaigns.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); CallRecording recording = client.CallsApi.GetCallRecordingByName(1234, "testName"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/calls/15/recordings/hello"

Example Response

                    
                      

{ "id": 2033, "callId": 101, "campaignId": 15, "name": "hello", "created": 1443382635000, "lengthInBytes": 12345, "lengthInSeconds": 9, "hash": "", "mp3Url": "https://api.callfire.com/calls/recordings/2033", "state": "READY" }

Get call mp3 recording by name get

Returns a MP3 recording of a particular call, response contains binary data, content type is 'audio/mpeg'

path

  • https://api.callfire.com/v2/calls/{id}/recordings/{name}.mp3 GET

parameters

  • id integer required

    An id of a call

  • name string required

    A name of a recording

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient;

import java.io.InputStream;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); InputStream is = client.callsApi().getCallRecordingMp3ByName(1234L, "testName"); } }

Sample Code

              
                

using System.IO; using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); Stream stream = client.CallsApi.GetCallRecordingMp3ByName(1234, "testName"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/calls/15/recordings/hello.mp3"

Example Response

                    
                      

mp3 binary file response

Find a specific batch get

Returns a single Batch instance for a given batch id. This API is useful for determining the state of a validating batch

path

  • https://api.callfire.com/v2/campaigns/batches/{id} GET

parameters

  • id integer required

    An id of a batch

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.Batch;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("api_login", "api_password"); Batch batch = callfireClient.batchesApi().get(1234L); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Campaigns.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); Batch batch = client.BatchesApi.Get(1234); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password "https://api.callfire.com/v2/campaigns/batches/1"

Example Response

                    
                      

{ "id": 1, "name": "CF2 Campaign Sample", "status": "ACTIVE", "broadcastId": 1, "created": 1297474980000, "size": 6198, "remaining": 0, "enabled": true }

Update a batch put

Updates a single Batch instance, currently batch can only be turned "on/off"

path

  • https://api.callfire.com/v2/campaigns/batches/{id} PUT

parameters

  • id integer required

    An id of a batch to update

  • body {...} ref

    Batch

  • broadcastId integer

    An id of broadcast which batch belongs to

  • created integer

    A date and time when batch was created, formatted in unix time milliseconds. Example: 1473781817000 for Sat, 05 Jan 1985 14:03:37 GMT

  • enabled boolean

    An enabled batch. If batch is disabled its contacts remain undialed/untexted

  • id integer

    A id of a batch

  • name string

    A batch name

  • remaining integer

    A number of contacts remaining undialed/untexted

  • size integer

    A total number of contacts in batch

  • status string

    A status of batch (NEW, VALIDATING, ERRORS, SOURCE_ERROR, ACTIVE). NEW - batch is queued for validation; VALIDATING - batch is currently validating; ERRORS - batch is processed, some validation errors occurred; SOURCE_ERROR - if contact source is contact list in Callfire system and it has an error; ACTIVE - batch is processed and ready

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.Batch;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); Batch batch = client.batchesApi().get(1234L); batch.setEnabled(false); client.batchesApi().update(batch); Batch updatedBatch = client.batchesApi().get(1234L); } }

Sample Code

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var batch = client.BatchesApi.Get(1234); batch.Enabled = false; client.BatchesApi.Update(batch); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X PUT -d ' { "enabled":"false" }' "https://api.callfire.com/v2/campaigns/batches/1"

Example Response

                    
                      

200 OK - No Response

Find sounds get

To find all campaign sounds which were created by user. Returns all sounds available to be used in campaigns

path

  • https://api.callfire.com/v2/campaigns/sounds GET

parameters

  • limit integer

    To set the maximum number of records to return in a paged list response. The default is 100

  • offset integer

    Offset to the start of a given page. The default is 0. Check [pagination](https://developers.callfire.com/docs.html#pagination) page for more information about pagination in CallFire API.

  • filter string

    Name of a file to search for

  • includeArchived boolean

    Includes ARCHIVED sounds for "true" value

  • includePending boolean

    Includes UPLOAD/RECORDING sounds for "true" value

  • includeScrubbed boolean

    Includes SCRUBBED sounds for "true" value

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.CampaignSound; import com.callfire.api.client.api.campaigns.model.request.FindSoundsRequest; import com.callfire.api.client.api.common.model.Page;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("api_login", "api_password"); FindSoundsRequest request = FindSoundsRequest.create() .limit(3L) .filter("sample") .build(); Page campaignSounds = callfireClient.campaignSoundsApi().find(request); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.CallsTexts.Model.Request; using CallfireApiClient.Api.Campaigns.Model; using CallfireApiClient.Api.Common.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); FindSoundsRequest request = new FindSoundsRequest { Limit = 3, Filter = "sample" }; Page campaignSounds = client.CampaignSoundsApi.Find(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/campaigns/sounds"

Example Response

                    
                      

{ "items": [ { "id": 60, "name": "TTS: And hello to you too.", "created": 1443333911000, "lengthInSeconds": 1, "status": "ACTIVE" }, { "id": 59, "name": "TTS: Why hello there!", "created": 1443333905000, "lengthInSeconds": 1, "status": "ACTIVE" } ], "limit": 100, "offset": 0, "totalCount": 8 }

Add sound via call post

Use this API to create a sound via a phone call. Provide the required phone number in the CallCreateSound object inside the request, and user will receive a call shortly after with instructions on how to record a sound over the phone.

path

  • https://api.callfire.com/v2/campaigns/sounds/calls POST

parameters

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

  • body {...} ref

    CallCreateSound

  • name string

    Name of a sound to create

  • toNumber string

    Phone number in E.164 11-digit format to call to record a sound. Example: 12132000384

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.CallCreateSound; import com.callfire.api.client.api.common.model.ResourceId;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("api_login", "api_password"); CallCreateSound callCreateSound = new CallCreateSound(); callCreateSound.setName("CallInSound_1"); callCreateSound.setToNumber("12131234567"); ResourceId resourceId = callfireClient.campaignSoundsApi().recordViaPhone(callCreateSound); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Campaigns.Model; using CallfireApiClient.Api.Common.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var callCreateSound = new CallCreateSound { Name = "call_in_sound", ToNumber = "12132212384" }; ResourceId resourceId = client.CampaignSoundsApi.RecordViaPhone(callCreateSound); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X POST -d ' { "name":"Sound 1", "toNumber":"12135551122" }' "https://api.callfire.com/v2/campaigns/sounds/calls"

Example Response

                    
                      

{ "id": 61 }

Add sound via file post

Create a campaign sound file via a supplied .mp3 or .wav file

path

  • https://api.callfire.com/v2/campaigns/sounds/files POST

parameters

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.CampaignSound;

import java.io.File; import java.net.URISyntaxException;

class ApiClientSample { public static void main(String[] args) throws URISyntaxException { CallfireClient client = new CallfireClient("api_login", "api_password"); File mp3File = new File(ApiClientSample.class.getClassLoader().getResource("/path/to/sound.mp3").toURI()); CampaignSound mp3Sound = client.campaignSoundsApi().uploadAndGetSoundDetails(mp3File, "Sound 1"); } }

Sample Code

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var mp3 = client.CampaignSoundsApi.Upload("path/to/file.mp3", "Sound 1"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -X POST -F 'file=@/path/to/sound.mp3' "https://api.callfire.com/v2/campaigns/sounds/files"

Example Response

                    
                      

{ "id": 63 }

Add sound via text-to-speech post

Use this API to create a sound file via a supplied string of text. Add a text in the TextToSpeech.message field, and pick a voice in the TextToSpeech.voice field. Available voices are: MALE1, FEMALE1, FEMALE2, SPANISH1, FRENCHCANADIAN1

path

  • https://api.callfire.com/v2/campaigns/sounds/tts POST

parameters

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

  • body {...} ref

    TextToSpeech

  • message string

    A text to be turned into sound

  • voice string

    A voice to be used. Available values: MALE1, FEMALE1 , FEMALE2, SPANISH1, FRENCHCANADIAN1

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.TextToSpeech; import com.callfire.api.client.api.campaigns.model.Voice; import com.callfire.api.client.api.common.model.ResourceId;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("api_login", "api_password"); TextToSpeech tts = new TextToSpeech(); tts.setVoice(Voice.FEMALE1); tts.setMessage("this is TTS message from java client"); ResourceId resourceId = callfireClient.campaignSoundsApi().createFromTts(tts); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Campaigns.Model; using CallfireApiClient.Api.Common.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var tts = new TextToSpeech { Message = "this is TTS message from csharp client" }; ResourceId resourceId = client.CampaignSoundsApi.CreateFromTts(tts); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X POST -d ' { "voice":"MALE1", "message":"This is a TTS sound" }' "https://api.callfire.com/v2/campaigns/sounds/tts"

Example Response

                    
                      

{ "id": 62 }

Find a specific sound get

Returns a single CampaignSound instance for a given sound id in campaign. This is a meta data to the sounds. No audio data is returned from this API

path

  • https://api.callfire.com/v2/campaigns/sounds/{id} GET

parameters

  • id integer required

    An id of a sound campaign

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.CampaignSound;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); Long id = 12345L; // use second argument to limit returned fields CampaignSound campaignSound = client.campaignSoundsApi().get(id, "name,status,lengthInSeconds"); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Campaigns.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); // limit returned fields if needed, e.g. "name,status,lengthInSeconds" CampaignSound campaignSound = client.CampaignSoundsApi.Get(12345); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/campaigns/sounds/61"

Example Response

                    
                      

{ "id": 61, "name": "My sound file", "created": 1443378307000, "lengthInSeconds": 3, "status": "ACTIVE" }

Delete a specific sound delete

Deletes a single campaign sound instance for a specific campaign sound id, this operation does not delete sound completely, it sets sound status to ARCHIVED which means that sound will no longer appear in 'find' operation results, but still accessible via 'get' operation

path

  • https://api.callfire.com/v2/campaigns/sounds/{id} DELETE

parameters

  • id integer required

    An id of a campaign sound

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); Long id = 12345L; client.campaignSoundsApi().delete(id); } }

Sample Code

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); client.CampaignSoundsApi.Delete(12345); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X DELETE "https://api.callfire.com/v2/campaigns/sounds/61"

Example Response

                    
                      

200 OK - No Response

Download a MP3 sound get

Download the MP3 version of a hosted file. This is an audio data endpoint. Returns binary response of the 'audio/mpeg' content type

path

  • https://api.callfire.com/v2/campaigns/sounds/{id}.mp3 GET

parameters

  • id integer required

    An id of a campaign sound

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient;

import java.io.InputStream;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("api_login", "api_password"); InputStream is = callfireClient.campaignSoundsApi().getMp3(12345L); } }

Sample Code

              
                

using System.IO; using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); Stream stream = client.CampaignSoundsApi.GetMp3(12345); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/campaigns/sounds/61.mp3"

Example Response

                    
                      

mp3 binary file response

Download a WAV sound get

Download the WAV version of the hosted file. This is an audio data endpoint. Returns binary response of the 'audio/mpeg' content type

path

  • https://api.callfire.com/v2/campaigns/sounds/{id}.wav GET

parameters

  • id integer required

    An id of a campaign sound

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient;

import java.io.InputStream;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("api_login", "api_password"); InputStream is = callfireClient.campaignSoundsApi().getWav(12345L); } }

Sample Code

              
                

using System.IO; using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); Stream stream = client.CampaignSoundsApi.GetWav(12345); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/campaigns/sounds/61.wav"

Example Response

                    
                      

wav binary file response

Create contacts post

Creates contacts in CallFire system. These contacts are not validated on creation. They will be validated upon being added to a campaign

path

  • https://api.callfire.com/v2/contacts POST

parameters

  • body {...} list of ref

    List of Contact

  • deleted boolean

    A deleted contact, deleted contacts are hidden from search results

  • externalId string

    An external id of a contact for syncing with external sources

  • externalSystem string

    External system that external id refers to

  • firstName string

    A first name of a contact

  • homePhone string

    Phone number in E.164 format (11-digit). Example: 12132000384

  • id integer

    An id of a contact

  • lastName string

    A last name of a contact

  • mobilePhone string

    Phone number in E.164 format (11-digit). Example: 12132000384

  • properties object

    Map of user-defined string properties for contact

  • workPhone string

    Phone number in E.164 format (11-digit). Example: 12132000384

  • zipcode string

    A Zip code of a contact

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.common.model.ResourceId; import com.callfire.api.client.api.contacts.model.Contact;

import java.util.Arrays; import java.util.List;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); Contact contact = new Contact(); contact.setFirstName("John"); contact.setLastName("Doe"); contact.setHomePhone("16505044730"); contact.getProperties().put("age", "30"); contact.getProperties().put("customField", "customValue"); List inputContacts = Arrays.asList(contact); List resultResourceIds = client.contactsApi().create(inputContacts); } }

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.Common.Model; using CallfireApiClient.Api.Contacts.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password");

    var contact = new Contact
    {
        HomePhone = "16505044730",
        FirstName = "John",
        LastName = "Doe",
        Properties = new Dictionary<string, string>
        {
            {"age", "30"},
            {"customFieldN", "customValue"}
        }
    };
    IList<ResourceId> contacts = client.ContactsApi.Create(new List<Contact> {contact});
}

}

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST -d ' [ { "firstName":"Alice", "lastName":"Moore", "homePhone":"12135551124", "mobilePhone":"12136666123", "workPhone":"14553327789", "zipcode":"40460", "properties": { "custom_age":30, "custom_position":"Manager" } }, { "firstName":"Bob", "lastName":"Smith", "homePhone":"17885551111", "mobilePhone":"17886666122", "workPhone":"17883327700", "zipcode":"25600", "properties": { "custom_ext_system_id":100200301 } } ]' "https://api.callfire.com/v2/contacts"

Example Response

                    
                      

{ "items": [ { "id": 4103 }, { "id": 4104 } ] }

Find contacts get

Find user's contacts by id, contact list, or on any property name. Returns a paged list of contacts

path

  • https://api.callfire.com/v2/contacts GET

parameters

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

  • limit integer

    To set the maximum number of records to return in a paged list response. The default is 100

  • offset integer

    Offset to the start of a given page. The default is 0. Check [pagination](https://developers.callfire.com/docs.html#pagination) page for more information about pagination in CallFire API.

  • id array

    A list of contact IDs. If the id parameter is included, the other query parameters are ignored.

  • number array

    Multiple contact numbers can be specified. If the number parameter is included, the other query parameters are ignored.

  • contactListId integer

    Filters contacts by a particular contact list

  • propertyName string

    Name of a contact property to search by

  • propertyValue string

    Value of a contact property to search by

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.common.model.Page; import com.callfire.api.client.api.contacts.model.Contact; import com.callfire.api.client.api.contacts.model.request.FindContactsRequest;

import java.util.Arrays;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); FindContactsRequest request = FindContactsRequest.create() .limit(1L) .offset(5L) .id(Arrays.asList(463633187003L, 466225637003L)) .build(); Page contacts = client.contactsApi().find(request); } }

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.Common.Model; using CallfireApiClient.Api.Contacts.Model; using CallfireApiClient.Api.Contacts.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password");

    var request = new FindContactsRequest
    {
        Number = new List<string> {"16506190257", "18778973473"},
        Id = new List<long> {1, 2},
        Limit = 1,
        Offset = 0
    };
    Page<Contact> contacts = client.ContactsApi.Find(request);
}

}

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/contacts?id=88970899000&id=88971899000&id=88970566000"

Example Response

                    
                      

{ "items": [ { "id":88970899000 "firstName":"Alice", "lastName":"Moore", "homePhone":"12135551124", "mobilePhone":"12136666123", "workPhone":"14553327789", "zipcode":"40460", "properties": { "custom_age":30, "custom_position":"Manager" } }, { "id":88971899000 "firstName":"Bob", "lastName":"Smith", "homePhone":"17885551111", "mobilePhone":"17886666122", "workPhone":"17883327700", "zipcode":"25600", "properties": { "custom_ext_system_id":100200301 } } ], "limit": 10, "offset": 0, "totalCount": 2 }

Add or update do not contact (dnc) numbers post

Add or update a list of Do Not Contact (DNC) contact entries. Can toggle whether the DNCs are enabled for calls/texts.

path

  • https://api.callfire.com/v2/contacts/dncs POST

parameters

  • body {...} ref

    AddDoNotContactRequest

  • call boolean

    ~

  • numbers array

    ~

  • source string

    ~

  • text boolean

    ~

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.contacts.model.request.CreateDncsRequest;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); CreateDncsRequest request = CreateDncsRequest.create() // prohibit dialing to given phone numbers .call(true) // prohibit texting to given phone numbers .text(true) // the list of phone numbers .numbers(Arrays.asList("12135551188", "12135771124")) // optional the name of the source .source("My DNCs List 1") .build(); client.dncApi().create(request); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Contacts.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); CreateDncsRequest request = new CreateDncsRequest() { // prohibit dialing to given phone numbers Call = true, // prohibit texting to given phone numbers Text = true, // the list of phone numbers Numbers = new List { "12135551188", "12135771124" }, // optional the name of the source Source = "My DNCs List 1" }; client.DncApi.Create(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST -d ' { "source": "My DNC list 1", "call": true, "text": true, "numbers": ["12132000381", "12132000382", "12132000383"] }' "https://api.callfire.com/v2/contacts/dncs"

Example Response

                    
                      

200 OK - No Response

Find do not contact (dnc) items get

Searches for all Do Not Contact (DNC) objects created by user. These DoNotContact entries only affect calls/texts/campaigns on this account. Returns a paged list of DoNotContact objects

path

  • https://api.callfire.com/v2/contacts/dncs GET

parameters

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

  • limit integer

    To set the maximum number of records to return in a paged list response. The default is 100

  • offset integer

    Offset to the start of a given page. The default is 0. Check [pagination](https://developers.callfire.com/docs.html#pagination) page for more information about pagination in CallFire API.

  • prefix string

    Prefix (1-10 digits) of phone numbers

  • campaignId integer

    ~

  • source string

    ~

  • call boolean

    ~

  • text boolean

    ~

  • number array

    ~

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.common.model.Page; import com.callfire.api.client.api.contacts.model.DoNotContact; import com.callfire.api.client.api.contacts.model.request.FindDncNumbersRequest;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); FindDncNumbersRequest request = FindDncNumbersRequest.create() // search only Do-Not-Text numbers .text(true) // search numbers starting 1-(424) .prefix("1424") // limit response to 10 entries .limit(10L) .build(); Page dncContacts = client.dncApi().find(request); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Common.Model; using CallfireApiClient.Api.Contacts.Model; using CallfireApiClient.Api.Contacts.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new FindDncNumbersRequest() { // search only Do-Not-Text numbers Text = true, // search numbers starting 1-(424) Prefix = "1424", // limit response to 10 entries Limit = 10 }; Page dncs = client.DncApi.Find(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/contacts/dncs?text=true"

Example Response

                    
                      

{ "items": [ { "number": "12132000381", "call": true, "text": true }, { "number": "12132000382", "call": true, "text": true }, { "number": "12132000383", "call": true, "text": true } ], "totalCount": 3 }

Delete do not contact (dnc) numbers contained in source. delete

Delete Do Not Contact (DNC) contact entries contained in source.

path

  • https://api.callfire.com/v2/contacts/dncs/sources/{source} DELETE

parameters

  • source string required

    Source associated with Do Not Contact (DNC) entry.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); client.dncApi().deleteDncsFromSource("My DNC Source 1"); } }

Sample Code

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); client.DncApi.DeleteDncsFromSource("My DNC Source 1"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X DELETE "https://api.callfire.com/v2/contacts/dncs/sources/My DNC List 1"

Example Response

                    
                      

204 - No Content

Find universal do not contacts (udnc) associated with toNumber get

Searches for a UniversalDoNotContact object for a given phone number. Shows whether inbound/outbound actions are allowed for a given number

path

  • https://api.callfire.com/v2/contacts/dncs/universals/{toNumber} GET

parameters

  • toNumber string required

    A required destination phone number in E.164 format (11-digit). Example: 12132000384

  • fromNumber string

    An optional destination/source number for DNC, specified in E.164 format (11-digit). Example: 12132000384

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.contacts.model.UniversalDnc; import com.callfire.api.client.api.contacts.model.request.FindUniversalDncsRequest;

import java.util.List;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); FindUniversalDncsRequest request = FindUniversalDncsRequest.create() // find all universal DNCs which prohibit from contacting toNumber .toNumber("12135551188") .build(); List universalDncs = client.dncApi().findUniversalDncs(request); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Contacts.Model; using CallfireApiClient.Api.Contacts.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); FindUniversalDncsRequest request = new FindUniversalDncsRequest() { // find all universal DNCs which prohibit from contacting toNumber ToNumber = "12135551188" }; IList universalDncs = client.DncApi.FindUniversalDncs(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/contacts/dncs/universals/12132212381"

Example Response

                    
                      

{ "items": [ { "toNumber": "12132212381", "inboundCall": false, "inboundText": false, "outboundCall": true, "outboundText": true } ] }

Get do not contact (dnc) get

Get Do Not Contact (DNC) object create by user. This DoNotContact entry only affects calls/texts/campaigns on this account.

path

  • https://api.callfire.com/v2/contacts/dncs/{number} GET

parameters

  • number string required

    Number associated with Do Not Contact (DNC) entry.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.contacts.model.DoNotContact;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); DoNotContact dnc = client.dncApi().get("12135551188"); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Contacts.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); DoNotContact dnc = client.DncApi.Get("12135551188"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/contacts/dncs/12132212381"

Example Response

                    
                      

{ "number": "12132000381", "call": true, "text": true, "created": 1443390407000 }

Delete do not contact (dnc) number. If number contains commas treat as list of numbers delete

Delete a Do Not Contact (DNC) contact entry.

path

  • https://api.callfire.com/v2/contacts/dncs/{number} DELETE

parameters

  • number string required

    Number associated with Do Not Contact (DNC) entry.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); client.dncApi().delete("12135551188"); } }

Sample Code

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); client.DncApi.Delete("12135551188"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X DELETE "https://api.callfire.com/v2/contacts/dncs/12132212381"

Example Response

                    
                      

204 - No Content

Update an individual do not contact (dnc) number put

Update a Do Not Contact (DNC) contact entry. Can toggle whether the DNC is enabled for calls/texts.

path

  • https://api.callfire.com/v2/contacts/dncs/{number} PUT

parameters

  • number string required

    ~

  • body {...} ref

    DoNotContact

  • call boolean

    A number on Do-Not-Call list

  • campaignId integer

    ~

  • created integer

    ~

  • number string

    A single DNC number in E.164 format (11-digit). Example: 12132000384

  • source string

    ~

  • text boolean

    A number on Do-Not-Text list

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.contacts.model.request.UpdateDncRequest;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); UpdateDncRequest request = UpdateDncRequest.create() // prohibit dialing to phone number .call(true) // allow text messaging .text(false) .number("12135551188") .build(); client.dncApi().update(request); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Contacts.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); UpdateDncRequest request = new UpdateDncRequest() { // prohibit dialing to phone number Call = true, // allow text messaging Text = false, Number = "12135551188" }; client.DncApi.Update(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X PUT -d ' { "call": true, "text": true, "source": "My DNC list 1" }' "https://api.callfire.com/v2/contacts/dncs/12132212384"

Example Response

                    
                      

200 OK - No Response

Create contact lists post

Creates a contact list for use with campaigns using 1 of 3 inputs. A List of Contact objects, a list of String E.164 numbers, or a list of CallFire contactIds can be used as the data source for the created contact list. After contact list is added into the CallFire system, contact lists goes through seven system safeguards that check the accuracy and consistency of the data. For example, our system checks that contact number is formatted correctly, is valid, is not duplicated in another contact list, or is not added on a specific DNC list. The default resolution in these safeguards will remove contacts which do not complies these rules. If contacts were not added to a contact list after the validation, this means the data needs to be properly formatted and corrected before calling this API

path

  • https://api.callfire.com/v2/contacts/lists POST

parameters

  • body {...} ref

    CreateContactListRequest

  • contactIds array

    A list of ids of existing contacts in Callfire system

  • contactNumbers array

    List of numbers in E.164 format (11-digit). Example: 12132000384

  • contactNumbersField string

    A type of a phone number (homePhone, workPhone, mobilePhone). This parameter is used with contactNumbers and specifies which types of phone numbers are included to a contact list

  • contacts array

    A list of new contact objects to be added

  • name string

    A name of a contact list

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.common.model.ResourceId; import com.callfire.api.client.api.contacts.model.Contact; import com.callfire.api.client.api.contacts.model.request.CreateContactListRequest;

import java.util.Arrays;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); CreateContactListRequest request1 = CreateContactListRequest.create() .name("listFromNumbers") .contacts(Arrays.asList("12135678881", "12135678882")) .build(); ResourceId resourceId1 = client.contactListsApi().create(request1);

    // second example shows how to create contact list from existing contacts, what we need is just their ids:
    CreateContactListRequest request2 = CreateContactListRequest.<Long>create()
        .name("listFromExistingContacts")
        .contacts(Arrays.asList(123L, 456L, 789L))
        .build();
    ResourceId resourceId2 = client.contactListsApi().create(request2);

    // next code sample uses Contact object in CreateContactListRequest request:
    Contact contact = new Contact();
    contact.setFirstName("John");
    contact.setHomePhone("16505044730");
    contact.getProperties().put("age", "30");
    CreateContactListRequest request3 = CreateContactListRequest.<Contact>create()
        .name("listFromContacts")
        .contacts(Arrays.asList(contact))
        .build();
    ResourceId resourceId3 = client.contactListsApi().create(request3);
}

}

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.Common.Model; using CallfireApiClient.Api.Contacts.Model; using CallfireApiClient.Api.Contacts.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password");

    // this sample shows how add create contact list from 3 different
    // sources: list of numbers, list of existing contact IDs, list of contact objects
    var request1 = new CreateContactListRequest<string>
    {
        Contacts = new List<string> {"12135678881", "12135678882"},
        Name = "listFromNumbers"
    };
    ResourceId resourceId1 = client.ContactListsApi.Create(request1);

    var request2 = new CreateContactListRequest<long>
    {
        Contacts = new List<long> {123, 456, 789},
        Name = "listFromIds"
    };
    ResourceId resourceId2 = client.ContactListsApi.Create(request2);

    var request3 = new CreateContactListRequest<Contact>
    {
        Contacts = new List<Contact> {new Contact {FirstName = "John", HomePhone = "16505044730"}},
        Name = "listFromContacts"
    };
    ResourceId resourceId3 = client.ContactListsApi.Create(request3);
}

}

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST -d ' { "name":"Created Contact List", "contacts": [ { "firstName":"Carl", "lastName":"Friar", "homePhone":"12135551125" } ] }' "https://api.callfire.com/v2/contacts/lists"

Example Response

                    
                      

{ "id": 3 }

Find contact lists get

Searches for all contact lists which are available for the current user. Returns a paged list of contact lists

path

  • https://api.callfire.com/v2/contacts/lists GET

parameters

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

  • limit integer

    To set the maximum number of records to return in a paged list response. The default is 100

  • offset integer

    Offset to the start of a given page. The default is 0. Check [pagination](https://developers.callfire.com/docs.html#pagination) page for more information about pagination in CallFire API.

  • name string

    A name or a partial name of a contact list

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.common.model.Page; import com.callfire.api.client.api.contacts.model.ContactList; import com.callfire.api.client.api.contacts.model.request.FindContactListsRequest;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); FindContactListsRequest request = FindContactListsRequest.create() .limit(1L) .offset(1L) .name("listName") .build(); Page contactLists = client.contactListsApi().find(request); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Common.Model; using CallfireApiClient.Api.Contacts.Model; using CallfireApiClient.Api.Contacts.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password");

    var request = new FindContactListsRequest {Limit = 1, Offset = 0};
    Page<ContactList> contactLists = client.ContactListsApi.Find(request);
}

}

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/contacts/lists"

Example Response

                    
                      

{ "items": [ { "id": 3, "name": "Created Contact List", "size": 1, "created": 1443390407000, "status": "ACTIVE" } ], "totalCount": 1 }

Create contact list from file post

Creates a contact list to be used with campaigns through uploading a .csv file. Returns the id of created list

path

  • https://api.callfire.com/v2/contacts/lists/upload POST

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.common.model.ResourceId;

import java.io.File;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); File file = new File("/contacts/contacts-list.csv"); ResourceId resourceId = client.contactListsApi().createFromCsv("New contact list", file); } }

Sample Code

              
                

using System.IO; using CallfireApiClient; using CallfireApiClient.Api.Common.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password");

    var path = "Resources/File-examples/contacts1.csv";
    ResourceId listId = client.ContactListsApi.CreateFromCsv("fileList", Path.GetFullPath(path));
}

}

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -X POST -F "name=testing" -F "file=@small_contact_upload.csv" "https://api.callfire.com/v2/contacts/lists/upload"

Example Response

                    
                      

{ "id": 4 }

Find a specific contact list get

Returns a single ContactList instance for a given contact list id

path

  • https://api.callfire.com/v2/contacts/lists/{id} GET

parameters

  • id integer required

    An id of a contact list to return

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.contacts.model.ContactList;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); ContactList contactList = client.contactListsApi().get(1026694003L); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Contacts.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); ContactList contactList = client.ContactListsApi.Get(1026694003); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/contacts/lists/3"

Example Response

                    
                      

{ "id": 3, "name": "Created Contact List", "size": 1, "created": 1443390407000, "status": "ACTIVE" }

Delete a contact list delete

Deletes a contact list, included contacts will not be deleted.

path

  • https://api.callfire.com/v2/contacts/lists/{id} DELETE

parameters

  • id integer required

    An id of the contact list to be deleted

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); client.contactListsApi().delete(463633187003L); } }

Sample Code

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); client.ContactListsApi.Delete(463633187003); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X DELETE "https://api.callfire.com/v2/contacts/lists/3"

Example Response

                    
                      

204 - No Content

Update a contact list put

Updates contact list instance.

path

  • https://api.callfire.com/v2/contacts/lists/{id} PUT

parameters

  • id integer required

    An id of contact list to update

  • body {...} ref

    UpdateContactListRequest

  • name string

    A name of a contact list

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.contacts.model.request.UpdateContactListRequest;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); UpdateContactListRequest request = UpdateContactListRequest.create() .id(1026694003L) .name("sampleListName"). build(); client.contactListsApi().update(request); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Contacts.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new UpdateContactListRequest { Id = 1026694003, Name = "new name" }; client.ContactListsApi.Update(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X PUT -d ' { "name":"Created Contact List updated" }' "https://api.callfire.com/v2/contacts/lists/3"

Example Response

                    
                      

200 OK - No Response

Add contacts to a contact list post

Adds contacts to a contact list. Available contact sources are: list of the contact entities, list of ids of existing contacts in user's account, list of phone numbers in E.164 format (11-digits)

path

  • https://api.callfire.com/v2/contacts/lists/{id}/items POST

parameters

  • id integer required

    An id of a contact list

  • body {...} ref

    AddContactListContactsRequest

  • contactIds array

    A list of ids of existing contacts in Callfire system

  • contactNumbers array

    A phone number in E.164 format (11-digit). Examples: 12132000384

  • contactNumbersField string

    A type of phone number (homePhone, workPhone, mobilePhone). This parameter works together with contactNumbers and specifies which types of numbers are included to a list

  • contacts array

    A list of new contact objects which need to be added

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.contacts.model.Contact; import com.callfire.api.client.api.contacts.model.request.AddContactListItemsRequest;

import java.util.Arrays;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); AddContactListItemsRequest request1 = AddContactListItemsRequest.create() .contactListId(123456L) .contacts(Arrays.asList("12135678881", "12135678882")) .build(); client.contactListsApi().addListItems(request1);

    // second example shows how to create contact list from existing contacts, what we need is just their ids:
    AddContactListItemsRequest request2 = AddContactListItemsRequest.<Long>create()
        .contactListId(123456L)
        .contacts(Arrays.asList(123L, 456L, 789L))
        .build();
    client.contactListsApi().addListItems(request2);

    // next code sample uses Contact object in CreateContactListRequest request:
    Contact contact = new Contact();
    contact.setFirstName("John");
    contact.setHomePhone("16505044730");
    contact.getProperties().put("age", "30");
    AddContactListItemsRequest request3 = AddContactListItemsRequest.<Contact>create()
        .contactListId(123456L)
        .contacts(Arrays.asList(contact))
        .build();
    client.contactListsApi().addListItems(request3);
}

}

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.Contacts.Model; using CallfireApiClient.Api.Contacts.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password");

    // this sample shows how add contacts to existing list from 3 different 
    // sources: list of numbers, list of existing contact IDs, list of contact objects
    var request1 = new AddContactListContactsRequest<string>
    {
        Contacts = new List<string> {"12135678881", "12135678882"},
        ContactListId = 123456
    };
    client.ContactListsApi.AddListItems(request1);

    var request2 = new AddContactListContactsRequest<long>
    {
        Contacts = new List<long> {123, 456, 789},
        ContactListId = 123456
    };
    client.ContactListsApi.AddListItems(request2);

    var request3 = new AddContactListContactsRequest<Contact>
    {
        Contacts = new List<Contact> {new Contact {FirstName = "John", HomePhone = "16505044730"}},
        ContactListId = 123456
    };
    client.ContactListsApi.AddListItems(request3);
}

}

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST -d ' { "contacts": [ { "firstName":"Alice", "lastName":"Moore", "homePhone":"12135551126" }, { "firstName":"Bob", "lastName":"Smith", "homePhone":"12135551127", "properties": { "age":30 } } ] }' "https://api.callfire.com/v2/contacts/lists/3/items"

curl -u username:password -H "Content-Type:application/json" -X POST -d ' { "contactIds": [ 800634185003, 800734186003, 800834187003, 800984185003 ] }' "https://api.callfire.com/v2/contacts/lists/3/items"

curl -u username:password -H "Content-Type:application/json" -X POST -d ' { "contactNumbers": [ "12132212384", "12136612355", "12133312300" ], "contactNumbersField":"workPhone" }' "https://api.callfire.com/v2/contacts/lists/3/items"

Example Response

                    
                      

200 OK - No Response

Find contacts in a contact list get

Searches for all entries in a contact list with specified id. Returns a paged list of contact entries

path

  • https://api.callfire.com/v2/contacts/lists/{id}/items GET

parameters

  • id integer required

    An id of a contact list

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

  • limit integer

    To set the maximum number of records to return in a paged list response. The default is 100

  • offset integer

    Offset to the start of a given page. The default is 0. Check [pagination](https://developers.callfire.com/docs.html#pagination) page for more information about pagination in CallFire API.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.common.model.request.GetByIdRequest;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); client.contactListsApi().getListItems(GetByIdRequest.create().id(123456L).build()); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Common.Model; using CallfireApiClient.Api.Common.Model.Request; using CallfireApiClient.Api.Contacts.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new GetByIdRequest { Id = 123456, Limit = 100 }; Page contacts = client.ContactListsApi.GetListItems(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/contacts/lists/3/items"

Example Response

                    
                      

{ "items": [ { "id": 4104, "firstName": "Carl", "lastName": "Friar", "homePhone": "12135551125" }, { "id": 4105, "firstName": "Contact", "lastName": "One", "homePhone": "12135551126" }, { "id": 4106, "firstName": "Contact", "lastName": "Two", "homePhone": "12135551127" } ], "totalCount": 3 }

Delete contacts from a contact list delete

Deletes contacts from a contact list. List the contact ids in request to delete multiple contacts with one request.

path

  • https://api.callfire.com/v2/contacts/lists/{id}/items DELETE

parameters

  • id integer required

    A id of a contact list

  • contactId array

    An id of a contact entity in the CallFire system

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient;

import java.util.Arrays;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); client.contactListsApi().removeListItems(123456L, Arrays.asList(123456L, 111111L, 222222L)); } }

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); client.ContactListsApi.RemoveListItems(123456, new List {30344411, 30355511}); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X DELETE "https://api.callfire.com/v2/contacts/lists/3/items?contactId=4104"

Example Response

                    
                      

200 OK - No Response

Delete a contact from a contact list delete

Deletes a single contact from a contact list

path

  • https://api.callfire.com/v2/contacts/lists/{id}/items/{contactId} DELETE

parameters

  • id integer required

    An id of a contact list

  • contactId integer required

    An id of a contact

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); client.contactListsApi().removeListItem(123456L, 123456L); } }

Sample Code

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); client.ContactListsApi.RemoveListItem(123456, 30344411); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X DELETE "https://api.callfire.com/v2/contacts/lists/3/items/4105"

Example Response

                    
                      

200 OK - No Response

Find a specific contact get

Returns a Contact instance for a given contact id. Deleted contacts can be still retrieved but will be marked as deleted. Deleted contacts will not be shown in search request.

path

  • https://api.callfire.com/v2/contacts/{id} GET

parameters

  • id integer required

    An id of a contact

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.contacts.model.Contact;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); Contact contact = client.contactsApi().get(463633187003L); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Contacts.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password");

    Contact contact = client.ContactsApi.Get(463633187003);
}

}

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/contacts/4103"

Example Response

                    
                      

{ "id": 4103, "firstName": "Test", "lastName": "Contact", "homePhone": "12135551124", "workPhone": "1213555115" }

Delete a contact delete

Deletes a contact instance from account

path

  • https://api.callfire.com/v2/contacts/{id} DELETE

parameters

  • id integer required

    An Id of a contact

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); client.contactsApi().delete(463633187003L); } }

Sample Code

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); client.ContactsApi.Delete(463633187003); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X DELETE "https://api.callfire.com/v2/contacts/4103"

Example Response

                    
                      

204 - No Content

Update a contact put

Updates a single contact instance with id specified

path

  • https://api.callfire.com/v2/contacts/{id} PUT

parameters

  • id integer required

    An id of a contact

  • body {...} ref

    Contact

  • deleted boolean

    A deleted contact, deleted contacts are hidden from search results

  • externalId string

    An external id of a contact for syncing with external sources

  • externalSystem string

    External system that external id refers to

  • firstName string

    A first name of a contact

  • homePhone string

    Phone number in E.164 format (11-digit). Example: 12132000384

  • id integer

    An id of a contact

  • lastName string

    A last name of a contact

  • mobilePhone string

    Phone number in E.164 format (11-digit). Example: 12132000384

  • properties object

    Map of user-defined string properties for contact

  • workPhone string

    Phone number in E.164 format (11-digit). Example: 12132000384

  • zipcode string

    A Zip code of a contact

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.contacts.model.Contact;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); Contact contact = new Contact(); contact.setId(463633187003L); contact.setHomePhone("16505044730"); client.contactsApi().update(contact); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Contacts.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var contact = new Contact { Id = 463633187003, FirstName = "Alice", HomePhone = "16505044730", WorkPhone = "12305022730" }; client.ContactsApi.Update(contact); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X PUT -d ' { "workPhone":"1213555115" }' "https://api.callfire.com/v2/contacts/4103"

Example Response

                    
                      

200 OK - No Response

Find a contact's history get

Searches for all texts and calls attributed to a contact. Returns a list of calls and texts a contact has been involved with

path

  • https://api.callfire.com/v2/contacts/{id}/history GET

parameters

  • id integer required

    An Id of a contact

  • limit integer

    To set the maximum number of records to return in a paged list response. The default is 100

  • offset integer

    Offset to the start of a given page. The default is 0. Check [pagination](https://developers.callfire.com/docs.html#pagination) page for more information about pagination in CallFire API.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.common.model.request.GetByIdRequest; import com.callfire.api.client.api.contacts.model.ContactHistory;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); ContactHistory history = client.contactsApi().getHistory(GetByIdRequest.create().id(123456L).build()); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Common.Model.Request; using CallfireApiClient.Api.Contacts.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new GetByIdRequest { Id = 123456 }; ContactHistory contactHistory = client.ContactsApi.GetHistory(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/contacts/3089/history"

Example Response

                    
                      

{ "id": 3089, "calls": [ { "id": 12385, "fromNumber": "12135551189", "toNumber": "18089552643", "state": "READY", "campaignId": 8, "batchId": 5, "contact": { "id": 3089, "firstName": "Janet", "lastName": "Robertson", "workPhone": "18089552643" }, "inbound": false, "created": 1443332871000, "modified": 1443332871000, "agentCall": false }, { "id": 3089, "fromNumber": "12135551189", "toNumber": "18089552643", "state": "FINISHED", "campaignId": 1, "batchId": 1, "contact": { "id": 3089, "firstName": "Janet", "lastName": "Robertson", "workPhone": "18089552643" }, "inbound": false, "created": 1443332868000, "modified": 1443239245000, "finalCallResult": "NO_ANS", "records": [ { "id": 3089, "billedAmount": 0.0, "finishTime": 1443239245000, "callResult": "NO_ANS" } ], "agentCall": false } ], "texts": [ { "id": 6209, "fromNumber": "12135551189", "toNumber": "18089552643", "state": "FINISHED", "campaignId": 3, "batchId": 2, "contact": { "id": 3089, "firstName": "Janet", "lastName": "Robertson", "workPhone": "18089552643" }, "inbound": false, "created": 1443239245000, "modified": 1443239245000, "message": "Outbound test text message", "finalTextResult": "SENT", "records": [ { "id": 7215, "billedAmount": 0.03, "finishTime": 1443239245000, "message": "CallFire Rocks!", "textResult": "SENT" } ] } ] }

Find keywords get

Searches for all keywords available for purchase on the CallFire platform. If a keyword appears in the response, it is available for purchase. List the 'keywords' in a query parameter to search for multiple keywords (at least one keyword should be sent in request)

path

  • https://api.callfire.com/v2/keywords GET

parameters

  • keywords array

    A keyword to search for

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.keywords.model.Keyword;

import java.util.Arrays; import java.util.List;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); List keywords = client.keywordsApi().find(Arrays.asList("SUN", "MOON")); } }

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.Keywords.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); List keywords = new List {"SUN", "MOON"}; IList avaialbeKeywords = client.KeywordsApi.Find(keywords); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/keywords?keywords=SUN&keywords=MOON"

Example Response

                    
                      

{ "items": [ { "shortCode": "67076", "keyword": "SUN" }, { "shortCode": "67076", "keyword": "MOON" } ] }

Find keyword leases get

Searches for all keywords owned by user. A keyword lease is the ownership information involving a keyword

path

  • https://api.callfire.com/v2/keywords/leases GET

parameters

  • limit integer

    To set the maximum number of records to return in a paged list response. The default is 100

  • offset integer

    Offset to the start of a given page. The default is 0. Check [pagination](https://developers.callfire.com/docs.html#pagination) page for more information about pagination in CallFire API.

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.common.model.Page; import com.callfire.api.client.api.common.model.request.CommonFindRequest; import com.callfire.api.client.api.keywords.model.KeywordLease;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); CommonFindRequest request = CommonFindRequest.create().build(); Page leases = client.keywordLeasesApi().find(request); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Common.Model; using CallfireApiClient.Api.Common.Model.Request; using CallfireApiClient.Api.Keywords.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new CommonFindRequest { // pagination if needed Limit = 5, Offset = 10 }; Page leases = client.KeywordLeasesApi.Find(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/keywords/leases"

Example Response

                    
                      

{ "items": [ { "shortCode": "67076", "keyword": "CALLFIRE", "leaseBegin": 1000000000000, "leaseEnd": 1000000000000, "autoRenew": true, "status": "ACTIVE" } ], "limit": 100, "offset": 0, "totalCount": 1 }

Find a specific lease get

Searches for all keywords owned by user

path

  • https://api.callfire.com/v2/keywords/leases/{keyword} GET

parameters

  • keyword string required

    Keyword text that a lease is desired for

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.keywords.model.KeywordLease;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); KeywordLease keywordLease = client.keywordLeasesApi().get("CALLFIRE"); } }

Sample Code

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var lease = client.KeywordLeasesApi.Get("CALLFIRE"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/keywords/leases/CALLFIRE"

Example Response

                    
                      

{ "shortCode": "67076", "keyword": "CALLFIRE", "leaseBegin": 1000000000000, "leaseEnd": 1000000000000, "autoRenew": true, "status": "ACTIVE" }

Update a lease put

Updates a keyword lease. Turns the autoRenew on/off.

path

  • https://api.callfire.com/v2/keywords/leases/{keyword} PUT

parameters

  • keyword string required

    To update a keyword lease

  • body {...} ref

    KeywordLease

  • autoRenew boolean

    Enables the auto renewal of a keyword lease at the end of each billing cycle

  • keyword string

    A text used as a keyword

  • leaseBegin integer

    A time of a lease timestamp, formatted in unix time milliseconds (read only). Example: 1473781817000 for Sat, 05 Jan 1985 14:03:37 GMT

  • leaseEnd integer

    A date and time when the keyword lease is finishes. Timestamp, formatted in unix time milliseconds (read only). Example: 1473781817000

  • shortCode string

    A short code assigned to keyword. Example: 67076

  • status string

    A lease status. Available values: PENDING, ACTIVE, RELEASED, UNAVAILABLE

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.keywords.model.KeywordLease;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); KeywordLease keywordLease = new KeywordLease(); keywordLease.setKeyword("CALLFIRE"); keywordLease.setAutoRenew(true); client.keywordLeasesApi().update(keywordLease); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Keywords.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var lease = new KeywordLease { KeywordName = "CALLFIRE", AutoRenew = false }; client.KeywordLeasesApi.Update(lease); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X PUT -d ' { "autoRenew":"false" }' "https://api.callfire.com/v2/keywords/leases/CALLFIRE"

Example Response

                    
                      

200 OK - No Response

Check for a specific keyword get

Searches for the specific keyword to purchase on the CallFire platform. Returns 'true' if keyword is available.

path

  • https://api.callfire.com/v2/keywords/{keyword}/available GET

parameters

  • keyword string required

    To specify a keyword to search for. Example: SUN, MOON

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); Boolean available = client.keywordsApi().isAvailable("FIRE"); } }

Sample Code

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); bool isAvaialble = client.KeywordsApi.IsAvailable("JUICE"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/keywords/TEST/available"

Example Response

                    
                      

true

Find account details get

Searches for the user account details. Details include name, email, and basic account permissions

path

  • https://api.callfire.com/v2/me/account GET

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.account.model.Account;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("api_login", "api_password"); Account account = callfireClient.meApi().getAccount(); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Account.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); UserAccount account = client.MeApi.GetAccount(); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/me/account"

Example Response

                    
                      

{ "id": 1, "email": "test-account@callfire.com", "name": "Test Account", "firstName": "CallFire", "lastName": "Developer", "permissions": [ "ACCOUNT_HOLDER", "API" ] }

Create api credentials post

Creates an API credentials for the CallFire API. This endpoint requires full CallFire account credentials to be used, authenticated using Basic Authentication. At the moment user provides only the name for the credentials. The generated credentials can be used to access any CallFire APIs

path

  • https://api.callfire.com/v2/me/api/credentials POST

parameters

  • body {...} ref

    ApiCredential

  • enabled boolean

    Is credential enabled

  • id integer

    An id of an API credential

  • name string

    A name of an API credential

  • password string

    A password for credential

  • username string

    Username for credential

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.account.model.ApiCredentials;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("account_login", "account_password"); ApiCredentials credentials = new ApiCredentials(); credentials.setName("api user"); credentials = callfireClient.meApi().createApiCredentials(credentials); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Account.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); ApiCredentials credentials = new ApiCredentials {Name = "test1"}; credentials = client.MeApi.CreateApiCredentials(credentials); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X POST -d ' { "name":"api_20_account" }' "https://api.callfire.com/v2/me/api/credentials"

Example Response

                    
                      

{ "id": 11, "name": "api_20_account", "username": "8a804bba69ba", "password": "aaaa000aaa00aa00", "enabled": true }

Find api credentials get

Searches for all credentials generated by user. Returns a paged list of the API credentials. Only ACCOUNT_HOLDER can invoke this API

path

  • https://api.callfire.com/v2/me/api/credentials GET

parameters

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

  • limit integer

    To set the maximum number of records to return in a paged list response. The default is 100

  • offset integer

    Offset to the start of a given page. The default is 0. Check [pagination](https://developers.callfire.com/docs.html#pagination) page for more information about pagination in CallFire API.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.account.model.ApiCredentials; import com.callfire.api.client.api.common.model.Page; import com.callfire.api.client.api.common.model.request.CommonFindRequest;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("account_login", "account_password"); CommonFindRequest request = CommonFindRequest.create() .limit(2L) .build(); Page credentials = callfireClient.meApi().findApiCredentials(request); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Account.Model; using CallfireApiClient.Api.Common.Model; using CallfireApiClient.Api.Common.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new CommonFindRequest {Limit = 2}; Page apiCredentials = client.MeApi.FindApiCredentials(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/me/api/credentials"

Example Response

                    
                      

{ "items": [ { "id": 11, "name": "api_20_account", "username": "8a804bba69ba", "password": "**aa00", "enabled": true } ], "totalCount": 1 }

Find a specific api credential get

Returns an API credential instance for a given api credential id. Only ACCOUNT_HOLDER can invoke this API

path

  • https://api.callfire.com/v2/me/api/credentials/{id} GET

parameters

  • id integer required

    An id of an API credential

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.account.model.ApiCredentials;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("account_login", "account_password"); // you can use 'fields' argument to limit returned fields ApiCredentials credentials = callfireClient.meApi().getApiCredentials(123456L, "name,enabled"); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Account.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); // add 2nd argument to limit returned fields ApiCredentials credentials = client.MeApi.GetApiCredentials(123456, "name,enabled"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/me/api/credentials/11"

Example Response

                    
                      

{ "id": 11, "name": "api_20_account", "username": "8a804bba69ba", "password": "**aa00", "enabled": true }

Delete api credentials delete

Deletes a specified API credential. Currently, removes the ability to access the API. Only ACCOUNT_HOLDER can invoke this API

path

  • https://api.callfire.com/v2/me/api/credentials/{id} DELETE

parameters

  • id integer required

    An id of an API credential

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("account_login", "account_password"); callfireClient.meApi().deleteApiCredentials(123456L); } }

Sample Code

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); client.MeApi.DeleteApiCredentials(123456); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X DELETE "https://api.callfire.com/v2/me/api/credentials/11"

Example Response

                    
                      

204 - No Content

Find credit usage get

Find credit usage for the user. Returns credits usage for time period specified or if unspecified then total for all time.

path

  • https://api.callfire.com/v2/me/billing/credit-usage GET

parameters

  • intervalBegin integer

    Beginning of usage period formatted in unix time milliseconds. Example: 1473781817000

  • intervalEnd integer

    End of usage period formatted in unix time milliseconds. Example: 1473781817000

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.account.model.CreditsUsage; import com.callfire.api.client.api.account.model.request.DateIntervalRequest;

import java.util.Calendar; import java.util.Date;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("api_login", "api_password"); Calendar endDateCal = Calendar.getInstance(); endDateCal.add(Calendar.MONTH, -3); DateIntervalRequest request = DateIntervalRequest.create() .intervalBegin(endDateCal.getTime()) .intervalEnd(new Date()) .build(); CreditsUsage creditsUsage = callfireClient.meApi().getCreditUsage(request); } }

Sample Code

              
                

using System; using CallfireApiClient; using CallfireApiClient.Api.Account.Model; using CallfireApiClient.Api.Account.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new DateIntervalRequest { IntervalBegin = DateTime.UtcNow.AddMonths(-2), IntervalEnd = DateTime.UtcNow }; CreditsUsage creditsUsage = client.MeApi.GetCreditUsage(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/me/billing/credit-usage"

Example Response

                    
                      

{ "intervalBegin": 1000000000000, "intervalEnd": 1000000000000, "callsDurationMinutes": 100, "textsSent": 100, "creditsUsed": 2015.0000 }

Find plan usage get

Searches for the data of a billing plan usage for the user. Returns the data of a billing plan usage for the current month

path

  • https://api.callfire.com/v2/me/billing/plan-usage GET

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.account.model.BillingPlanUsage;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("api_login", "api_password"); BillingPlanUsage billingPlanUsage = callfireClient.meApi().getBillingPlanUsage(); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Account.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); BillingPlanUsage usage = client.MeApi.GetBillingPlanUsage(); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/me/billing/plan-usage"

Example Response

                    
                      

{ "intervalStart": 1000000000000, "intervalEnd": 1000000000000, "remainingPlanCredits": 0.0000, "remainingPayAsYouGoCredits": 2015.0000, "totalRemainingCredits": 2015.0000 }

Find caller ids get

Returns a list of verified caller ids. If the number is not shown in the list, then it is not verified. In this case sending of a verification code is required.

path

  • https://api.callfire.com/v2/me/callerids GET

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.account.model.CallerId;

import java.util.List;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("api_login", "api_password"); List callerIds = callfireClient.meApi().getCallerIds(); } }

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.Account.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); IList callerIds = client.MeApi.GetCallerIds(); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/me/callerids"

Example Response

                    
                      

{ "items": [ { "phoneNumber": "12135551189" } ] }

Create a caller id post

Generates and sends a verification code to the phone number provided in the path. The verification code is delivered via a phone call. This code needs to be submitted to the verify caller id API endpoint to complete verification.

path

  • https://api.callfire.com/v2/me/callerids/{callerid} POST

parameters

  • callerid string required

    A phone number in E.164 format (11-digit) which needs to be verified. Example: 12132000384

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("api_login", "api_password"); String phoneNumber = "12132224444"; callfireClient.meApi().sendVerificationCode(phoneNumber); } }

Sample Code

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); const string phoneNumber = "12132224444"; client.MeApi.SendVerificationCode(phoneNumber); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X POST "https://api.callfire.com/v2/me/callerids/12135551100"

Example Response

                    
                      

200 OK - No Response

Verify a caller id post

With the verification code received from the Create caller id endpoint, a call to this endpoint is required to finish verification

path

  • https://api.callfire.com/v2/me/callerids/{callerid}/verification-code POST

parameters

  • callerid string required

    A phone number in E.164 format (11-digit) which needs to be verified. Example: 12132000384

  • body {...} ref

    CallerIdVerificationRequest

  • verificationCode string

    The code used to verify a caller id number

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.account.model.request.CallerIdVerificationRequest;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("api_login", "api_password"); String phoneNumber = "12132224444"; CallerIdVerificationRequest request = CallerIdVerificationRequest.create() .callerId(phoneNumber) .verificationCode("1234") .build(); Boolean verified = callfireClient.meApi().verifyCallerId(request); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Account.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new CallerIdVerificationRequest { CallerId = "12132212384", VerificationCode = "123" }; bool? verified = client.MeApi.VerifyCallerId(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X POST -d ' { "verificationCode":"1234" }' "https://api.callfire.com/v2/me/callerids/12135551175/verification-code"

Example Response

                    
                      

true

Create media post

Uploads media file to account, acceptable media formats: bmp, gif, jpg, m4a, mp3, mp4, png, wav

path

  • https://api.callfire.com/v2/media POST

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.common.model.ResourceId;

import java.io.File;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); File file = new File("/path/to/file/media.mp3"); // second argument is filename, in case you don't specify it filename will be taken from the path ResourceId id = client.mediaApi().upload(file); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Common.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); ResourceId resourceId = client.MediaApi.Upload("/path/to/file.mp3"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -X POST -F 'file=@test2.png;type=image/png;' "https://api.callfire.com/v2/media"

Example Response

                    
                      

{ "id": 1234 }

Download media by extension get

Download a media file. Available types of files: bmp, gif, jpg, m4a, mp3, mp4, png, wav. Content type in response depends on 'extension' parameter, e.g. image/jpeg, image/png, audio/mp3, etc

path

  • https://api.callfire.com/v2/media/public/{key}.{extension} GET

parameters

  • key string required

    A hash-key of a media resource

  • extension string required

    Media file type, available types: bmp, gif, jpg, m4a, mp3, mp4, png, wav

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.callstexts.model.MediaType;

import java.io.InputStream;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); InputStream is1 = client.mediaApi().getData(617067920003L, MediaType.MP3); // or you can get file by hash InputStream is2 = client.mediaApi().getData("450cffe3c128377a790df0059fb82fd6", MediaType.GIF); } }

Sample Code

              
                

import com.callfire.api.client.CallfireClient; using System.IO; using CallfireApiClient; using CallfireApiClient.Api.CallsTexts.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); Stream stream = client.MediaApi.GetData("450cffe3c128377a790df0059fb82fd6", MediaType.JPEG); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/media/public/ahashkey123.mp3"

Example Response

                    
                      

binary file response

Get a specific media get

Get media resource by id

path

  • https://api.callfire.com/v2/media/{id} GET

parameters

  • id integer required

    An id of a media resource

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.callstexts.model.Media;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); // you can limit what fields will be returned in second argument Media media = client.mediaApi().get(617067920003L); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.CallsTexts.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); Media media = client.MediaApi.Get(123456); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/media/2011"

Example Response

                    
                      

{ "id": 1234, "accountId": 54321, "name": "hello", "created": 1443382635000, "lengthInBytes": 123456, "mediaType": "MP3", "publicUrl": "https://www.callfire.com/v2/media/public/ahashkey123.mp3" }

Download media by extension get

Download a media file. Available types of files: bmp, gif, jpg, m4a, mp3, mp4, png, wav. Content type in response depends on 'extension' parameter, e.g. image/jpeg, image/png, audio/mp3, etc

path

  • https://api.callfire.com/v2/media/{id}.{extension} GET

parameters

  • id integer required

    An id of a media resource

  • extension string required

    Media file type. Available types: bmp, gif, jpg, m4a, mp3, mp4, png, wav

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.callstexts.model.MediaType;

import java.io.InputStream;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); InputStream is1 = client.mediaApi().getData(617067920003L, MediaType.MP3); // or you can get file by hash InputStream is2 = client.mediaApi().getData("450cffe3c128377a790df0059fb82fd6", MediaType.GIF); } }

Sample Code

              
                

using System.IO; using CallfireApiClient; using CallfireApiClient.Api.CallsTexts.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); Stream stream = client.MediaApi.GetData(123456, MediaType.JPEG); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/media/2011.mp3"

Example Response

                    
                      

binary file response

Download a MP3 media get

Download a MP3 media, endpoint returns application/binary content-type

path

  • https://api.callfire.com/v2/media/{id}/file GET

parameters

  • id integer required

    An id of a media resource

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.callstexts.model.MediaType;

import java.io.InputStream;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); InputStream is1 = client.mediaApi().getData(617067920003L, MediaType.MP3); // or you can get file by hash InputStream is2 = client.mediaApi().getData("450cffe3c128377a790df0059fb82fd6", MediaType.GIF); } }

Sample Code

              
                

import com.callfire.api.client.CallfireClient; using System.IO; using CallfireApiClient; using CallfireApiClient.Api.CallsTexts.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); Stream stream = client.MediaApi.GetData("450cffe3c128377a790df0059fb82fd6", MediaType.JPEG); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/media/2011.wav"

Example Response

                    
                      

binary file response

Find leases get

Searches for all numbers leased by account user. This API is useful for finding all numbers currently owned by the user. Returns a paged list of number leases.

path

  • https://api.callfire.com/v2/numbers/leases GET

parameters

  • limit integer

    To set the maximum number of records to return in a paged list response. The default is 100

  • offset integer

    Offset to the start of a given page. The default is 0. Check [pagination](https://developers.callfire.com/docs.html#pagination) page for more information about pagination in CallFire API.

  • prefix string

    A 4-7 digit prefix

  • city string

    A city name

  • state string

    A two-letter state code. Example: CA, IL, etc.

  • zipcode string

    A five-digit Zipcode

  • lata string

    A local access and transport area (LATA)

  • rateCenter string

    A rate center. A rate center is a geographical area used by a Local Exchange Carrier (LEC) to determine the boundaries for local calling, billing and allocation of phone numbers

  • labelName string

    A label name

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.common.model.Page; import com.callfire.api.client.api.numbers.model.NumberLease; import com.callfire.api.client.api.numbers.model.request.FindNumberLeasesRequest;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); FindNumberLeasesRequest request = FindNumberLeasesRequest.create() .city("REDWOOD CITY") .build(); Page leases = client.numberLeasesApi().find(request); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Common.Model; using CallfireApiClient.Api.Numbers.Model; using CallfireApiClient.Api.Numbers.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new FindNumberLeasesRequest {City = "REDWOOD CITY"}; Page leases = client.NumberLeasesApi.Find(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/numbers/leases"

Example Response

                    
                      

{ "items": [ { "number": "12135551100", "nationalFormat": "(213) 555-1100", "tollFree": false, "region": { "prefix": "1920659", "city": "APPLETON", "state": "WI", "zipcode": "54911", "lata": "350", "rateCenter": "APPLETON", "latitude": 44.2563, "longitude": -88.4018, "timeZone": "America/Chicago" }, "leaseBegin": 1305097200000, "leaseEnd": 1448606871000, "autoRenew": true, "status": "ACTIVE", "callFeatureStatus": "ENABLED", "textFeatureStatus": "ENABLED" }, { "number": "13025178999", "nationalFormat": "(302) 517-8999", "tollFree": false, "region": { "prefix": "1302517", "city": "HOCKESSIN", "state": "DE", "zipcode": "19707", "lata": "228", "rateCenter": "HOCKESSIN", "latitude": 39.7851, "longitude": -75.6984, "timeZone": "America/New_York" }, "autoRenew": true, "status": "ACTIVE", "callFeatureStatus": "UNSUPPORTED", "textFeatureStatus": "ENABLED" } ], "limit": 100, "offset": 0, "totalCount": 2 }

Find lease configs get

Searches for all number lease configs for the user. Returns a paged list of NumberConfig

path

  • https://api.callfire.com/v2/numbers/leases/configs GET

parameters

  • limit integer

    To set the maximum number of records to return in a paged list response. The default is 100

  • offset integer

    Offset to the start of a given page. The default is 0. Check [pagination](https://developers.callfire.com/docs.html#pagination) page for more information about pagination in CallFire API.

  • prefix string

    A 4-7 digit prefix

  • city string

    A city name

  • state string

    A two-letter state code. Example: CA, IL, etc.

  • zipcode string

    A five-digit Zipcode

  • lata string

    A local access and transport area (LATA)

  • rateCenter string

    A rate center. A rate center is a geographical area used by a Local Exchange Carrier (LEC) to determine the boundaries for local calling, billing and assigning phone numbers

  • labelName string

    A label name

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.common.model.Page; import com.callfire.api.client.api.numbers.model.NumberConfig; import com.callfire.api.client.api.numbers.model.request.FindNumberLeaseConfigsRequest;

class ApiClientSample { public static void main(String[] args) { FindNumberLeaseConfigsRequest request = FindNumberLeaseConfigsRequest.create().build(); CallfireClient client = new CallfireClient("api_login", "api_password"); Page configs = client.numberLeasesApi().findConfigs(request); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Common.Model; using CallfireApiClient.Api.Numbers.Model; using CallfireApiClient.Api.Numbers.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new FindNumberLeaseConfigsRequest(); Page configs = client.NumberLeasesApi.FindConfigs(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/numbers/leases/configs"

Example Response

                    
                      

{ "items": [ { "number": "12135551100", "configType": "IVR", "ivrInboundConfig": { "dialplanXml": "\n\t\n\t0\n\tfalse\n\tfalse\n\t\n

\n\t\tfalse\n\t\tEnter your pin number\n\t\t\n\t\t ${call.lastinput}\n\t\t\tauthenticating\n http://localhost:8080/callfire-api-impl/authentication/call-in/?pin=${call.lastinput}&callId=${call.id}\n \n Couldn't find that pin\n enter_pin_prompt\n \t\t\t\t\n \n \n Record after the beep. Press pound when done.\n \n Listen to recording, press 1. Save recording, press 2. Record again, press 3.\n \n ${recording}\n recording_options\n \n \n \n true\n Recording Saved. It will be available shortly.\n \n \n record\n \n \n\t\t\n\t\n\t\n\n" } }, { "number": "13025178999" } ], "limit": 100, "offset": 0, "totalCount": 2 }

Find a specific lease config get

Returns a single NumberConfig instance for a given number lease

path

  • https://api.callfire.com/v2/numbers/leases/configs/{number} GET

parameters

  • number string required

    A phone number in E.164 format (11-digit). Example: 12132000384

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.numbers.model.NumberConfig;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); NumberConfig config = client.numberLeasesApi().getConfig("16502572135"); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Numbers.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); NumberConfig config = client.NumberLeasesApi.GetConfig("16502572135"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/numbers/leases/configs/19206596476"

Example Response

                    
                      

{ "number": "12135551100", "configType": "TRACKING", "callTrackingConfig": { "transferNumbers": [ "12135551189", "12135551122" ], "screen": false, "recorded": true } }

Update a lease config put

Updates a phone number lease configuration. Use this API endpoint to add an Inbound IVR or Call Tracking feature to a CallFire phone number. Call tracking configuration allows you to track the incoming calls, to analyze and to respond customers using sms or voice replies. For more information see call tracking page

path

  • https://api.callfire.com/v2/numbers/leases/configs/{number} PUT

parameters

  • number string required

    A phone number in E.164 format (11-digit) which needs to be verified. Example: 12132000384

  • body {...} ref

    NumberConfig

  • callTrackingConfig ref

    Call tracking configuration, must be set if configType is TRACKING

  • configType string

    A type of config. Available values: TRACKING, IVR

  • ivrInboundConfig ref

    IVR configuration, must be set if configType is IVR

  • number string

    Phone number in E.164 format (11-digit). Example: 12132000384

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.numbers.model.CallTrackingConfig; import com.callfire.api.client.api.numbers.model.NumberConfig;

import java.util.Arrays;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); NumberConfig config = new NumberConfig(); config.setNumber("16502572135"); config.setConfigType(NumberConfig.ConfigType.TRACKING); // create call tracking config CallTrackingConfig callTrackingConfig = new CallTrackingConfig(); callTrackingConfig.setScreen(true); callTrackingConfig.setRecorded(true); callTrackingConfig.setTransferNumbers(Arrays.asList("16502572136", "16502572137")); config.setCallTrackingConfig(callTrackingConfig); // update number lease client.numberLeasesApi().updateConfig(config); } }

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.Numbers.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); // create new call tracking config var callTrackingConfig = new CallTrackingConfig { Screen = true, Recorded = true, TransferNumbers = new List {"16502572136", "16502572137"} }; NumberConfig config = new NumberConfig { Number = "16502572135", ConfigType = NumberConfig.NumberConfigType.TRACKING, CallTrackingConfig = callTrackingConfig }; client.NumberLeasesApi.UpdateConfig(config); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X PUT -d ' { "configType":"TRACKING", "callTrackingConfig": { "screen":"false", "recorded":"true", "voicemail":"true", "recorded":"true", "introSoundId":10004001, "whisperSoundId":10005002, "voicemailSoundId":10006003, "failedTransferSoundId":10007004, "transferNumbers": [ "12135551122", "12135551189" ], "weeklySchedule": { "startTimeOfDay": { "hour": 10, "minute": 0, "second": 0 }, "stopTimeOfDay": { "hour": 18, "minute": 0, "second": 0 }, "daysOfWeek": [ "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", ], "timeZone": "America/New_York" }, "googleAnalytics": { "domain":"domain-name", "googleAccountId":"UA-XXXXX-2X", "category":"Sales" } } }' "https://api.callfire.com/v2/numbers/leases/configs/19206596476"

Example Response

                    
                      

200 OK - No Response

Find a specific lease get

Updates a number lease instance. Ability to turn on/off autoRenew and toggle call/text features for a particular number

path

  • https://api.callfire.com/v2/numbers/leases/{number} GET

parameters

  • number string required

    A phone number in E.164 format (11-digit). Example: 12132000384

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.numbers.model.NumberLease;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); NumberLease lease = client.numberLeasesApi().get("16502572135"); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Numbers.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); NumberLease lease = client.NumberLeasesApi.Get("16502572135"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/numbers/leases/19206596476"

Example Response

                    
                      

{ "number": "12135551100", "nationalFormat": "(213) 555-1100", "tollFree": false, "region": { "prefix": "1920659", "city": "APPLETON", "state": "WI", "zipcode": "54911", "lata": "350", "rateCenter": "APPLETON", "latitude": 44.2563, "longitude": -88.4018, "timeZone": "America/Chicago" }, "leaseBegin": 1305097200000, "leaseEnd": 1448606871000, "autoRenew": true, "status": "ACTIVE", "callFeatureStatus": "ENABLED", "textFeatureStatus": "ENABLED" }

Update a lease put

Updates a number lease instance. Ability to turn on/off autoRenew and toggle call/text features for a particular number

path

  • https://api.callfire.com/v2/numbers/leases/{number} PUT

parameters

  • number string required

    A phone number in E.164 format (11-digit). Example: 12132000384

  • body {...} ref

    NumberLease

  • autoRenew boolean

    Enables the auto renewal of number lease at end of each billing cycle

  • callFeatureStatus string

    A status of a call feature. Available values: UNSUPPORTED, PENDING, DISABLED, ENABLED

  • labels array

    ~

  • leaseBegin integer

    A date and time of a lease start. Timestamp, formatted in unix time milliseconds (read only). Example: 1473781817000

  • leaseEnd integer

    A data and time of a lease finish. Timestamp, formatted in unix time milliseconds (read only). Example: 1473781817000

  • nationalFormat string

    Formatted number with a country code

  • number string

    A phone number in E.164 format (11-digit). Example: 12132000384

  • region ref

    A region object of a given number

  • status string

    A lease status. Available values: PENDING, ACTIVE, RELEASED, UNAVAILABLE

  • textFeatureStatus string

    A status of a text feature. Available values: UNSUPPORTED, PENDING, DISABLED, ENABLED

  • tollFree boolean

    A toll-free number

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.numbers.model.NumberLease;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); NumberLease lease = new NumberLease(); lease.setNumber("16502572135"); lease.setAutoRenew(true); client.numberLeasesApi().update(lease); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Numbers.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var lease = new NumberLease { PhoneNumber = "16502572135", AutoRenew = true }; client.NumberLeasesApi.Update(lease); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X PUT -d ' { "callFeatureStatus":"DISABLED", "autoRenew":"false" }' "https://api.callfire.com/v2/numbers/leases/19206596476"

Example Response

                    
                      

200 OK - No Response

Find local numbers get

Searches for numbers available for purchase in CallFire local numbers catalog . At least one additional parameter is required. User may filter local numbers by their region information.

path

  • https://api.callfire.com/v2/numbers/local GET

parameters

  • limit integer

    To set the maximum number of records to return in a paged list response. The default is 100

  • prefix string

    A 4-7 digit prefix

  • city string

    A city name

  • state string

    A two-letter state code. Example: CA, IL, etc.

  • zipcode string

    A five-digit Zipcode

  • lata string

    A local access and transport area (LATA)

  • rateCenter string

    A rate center. A rate center is a geographical area used by a Local Exchange Carrier (LEC) to determine the boundaries for local calling, billing and assigning phone numbers.

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.numbers.model.Number; import com.callfire.api.client.api.numbers.model.request.FindNumbersLocalRequest;

import java.util.List;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); // find 2 available local numbers by zipcode FindNumbersLocalRequest request = FindNumbersLocalRequest.create() .zipcode("90401") .limit(2L) .build(); List numbers = client.numbersApi().findNumbersLocal(request); } }

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.Numbers.Model; using CallfireApiClient.Api.Numbers.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new FindNumbersLocalRequest {Limit = 2, Zipcode = "90401"}; IList numbers = client.NumbersApi.FindNumbersLocal(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/numbers/local?zipcode=90401&limit=2"

Example Response

                    
                      

[ { "number": "13102308654", "nationalFormat": "(310) 230-8654", "tollFree": false, "region": { "prefix": "1310230", "city": "SANTA MONICA", "state": "CA", "zipcode": "90401", "lata": "730", "rateCenter": "SNMN SNMN", "latitude": 34.0428, "longitude": -118.5249, "timeZone": "America/Los_Angeles" } }, { "number": "13102301603", "nationalFormat": "(310) 230-1603", "tollFree": false, "region": { "prefix": "1310230", "city": "SANTA MONICA", "state": "CA", "zipcode": "90401", "lata": "730", "rateCenter": "SNMN SNMN", "latitude": 34.0428, "longitude": -118.5249, "timeZone": "America/Los_Angeles" } } ]

Find number regions get

Searches for region information. Use this API to obtain detailed region information that can be used to query for more specific phone numbers than a general query.

path

  • https://api.callfire.com/v2/numbers/regions GET

parameters

  • limit integer

    To set the maximum number of records to return in a paged list response. The default is 100

  • offset integer

    Offset to the start of a given page. The default is 0. Check [pagination](https://developers.callfire.com/docs.html#pagination) page for more information about pagination in CallFire API.

  • prefix string

    A 4-7 digit prefix

  • city string

    A city name

  • state string

    A two-letter state code. Example: CA, IL, etc.

  • zipcode string

    A five-digit Zipcode

  • lata string

    A local access and transport area (LATA)

  • rateCenter string

    A rate center. A rate center is a geographical area used by a Local Exchange Carrier (LEC) to determine the boundaries for local calling, billing and assigning phone numbers.

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.common.model.Page; import com.callfire.api.client.api.numbers.model.Region; import com.callfire.api.client.api.numbers.model.request.FindNumberRegionsRequest;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); FindNumberRegionsRequest request = FindNumberRegionsRequest.create() .limit(2L) .state("IL") .zipcode("60640") .build(); Page regions = client.numbersApi().findNumberRegions(request); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Common.Model; using CallfireApiClient.Api.Numbers.Model; using CallfireApiClient.Api.Numbers.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new FindNumberRegionsRequest { Limit = 2, State = "IL", Zipcode = "60640" }; Page regions = client.NumbersApi.FindNumberRegions(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/numbers/regions?zipcode=90401&limit=2"

Example Response

                    
                      

{ "items": [ { "prefix": "1310230", "city": "SANTA MONICA", "state": "CA", "zipcode": "90401", "lata": "730", "rateCenter": "SNMN SNMN", "latitude": 34.0428, "longitude": -118.5249, "timeZone": "America/Los_Angeles" }, { "prefix": "1310239", "city": "SANTA MONICA", "state": "CA", "zipcode": "90401", "lata": "730", "rateCenter": "SNMN SNMN", "latitude": 34.02, "longitude": -118.4904, "timeZone": "America/Los_Angeles" } ], "limit": 2, "offset": 0, "totalCount": 24 }

Find tollfree numbers get

Searches for the toll free numbers which are available for purchase in the CallFire catalog

path

  • https://api.callfire.com/v2/numbers/tollfree GET

parameters

  • pattern string

    Filter toll free numbers by prefix, pattern must be 3 char long and should end with '*'. Examples: 8**, 85*, 87* (but 855 will fail because pattern must end with '*').

  • limit integer

    To set the maximum number of records to return in a paged list response. The default is 100

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.common.model.request.CommonFindRequest; import com.callfire.api.client.api.numbers.model.Number;

import java.util.List;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); CommonFindRequest request = CommonFindRequest.create() .limit(2L) .offset(0L) .build(); List numbers = client.numbersApi().findNumbersTollfree(request); } }

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.Common.Model.Request; using CallfireApiClient.Api.Numbers.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new CommonFindRequest {Limit = 2, Offset = 0}; IList numbers = client.NumbersApi.FindNumbersTollfree(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/numbers/tollfree?limit=2"

Example Response

                    
                      

[ { "number": "18665552017", "nationalFormat": "(866) 555-2017", "tollFree": true }, { "number": "18665553366", "nationalFormat": "(866) 555-3366", "tollFree": true } ]

Purchase keywords post

Purchase keywords. Send a list of available keywords into this API to purchase them using CallFire credits. Make sure the account has enough credits before trying to purchase the keywords

path

  • https://api.callfire.com/v2/orders/keywords POST

parameters

  • body {...} ref

    KeywordPurchaseRequest

  • keywords array

    A list of keywords

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.common.model.ResourceId; import com.callfire.api.client.api.keywords.model.request.KeywordPurchaseRequest;

import java.util.Arrays;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("api_login", "api_password"); KeywordPurchaseRequest request = KeywordPurchaseRequest.create() .keywords(Arrays.asList("SUN", "MOON")).build(); ResourceId resourceId = callfireClient.ordersApi().orderKeywords(request); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Common.Model; using CallfireApiClient.Api.Keywords.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new KeywordPurchaseRequest {Keywords = {"SUN", "MOON"}}; ResourceId resourceId = client.OrdersApi.OrderKeywords(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X POST -d ' { "keywords": [ "SUN", "MOON" ] }' "https://api.callfire.com/v2/orders/keywords"

Example Response

                    
                      

{ "id": 12 }

Purchase numbers post

Purchase numbers. There are many ways to purchase a number. Set either 'tollFreeCount' or 'localCount' along with some querying fields to purchase numbers by bulk query. Set the list of numbers to purchase by list. Available numbers will be purchased using CallFire credits owned by the user. Make sure the account has enough credits before trying to purchase

path

  • https://api.callfire.com/v2/orders/numbers POST

parameters

  • body {...} ref

    NumberPurchaseRequest

  • city string

    City of requested numbers

  • lata string

    Local access and transport area of requested numbers

  • localCount integer

    Total count of local numbers requested

  • numbers array

    A list of phone numbers in E.164 format (11-digit) to buy. Example: 12132000384

  • prefix string

    Country prefix of requested numbers

  • rateCenter string

    A rate center of requested numbers

  • state string

    A two-letter state code of requested numbers

  • tollFreeCount integer

    Total count of toll-free numbers requested

  • zipcode string

    A five-digit Zip code of requested numbers

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.common.model.ResourceId; import com.callfire.api.client.api.numbers.model.request.NumberPurchaseRequest;

import java.util.Arrays;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("api_login", "api_password"); // request for buying particular numbers NumberPurchaseRequest request = NumberPurchaseRequest.create() .numbers(Arrays.asList("12131234567", "12131234568")) .build(); ResourceId resourceId = callfireClient.ordersApi().orderNumbers(request);

    // request for buying numbers in specific area
    NumberPurchaseRequest request2 = NumberPurchaseRequest.create()
        .zipcode("90401")
        .localCount(2)
        .build();
    ResourceId resourceId2 = callfireClient.ordersApi().orderNumbers(request2);
}

}

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.Common.Model; using CallfireApiClient.Api.Numbers.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); // request for buying particular numbers var request1 = new NumberPurchaseRequest { Numbers = new List {"12131234567", "12131234568"} }; ResourceId resourceId1 = client.OrdersApi.OrderNumbers(request1);

    // request for buying numbers in specific area
    var request2 = new NumberPurchaseRequest {Zipcode = "90401", LocalCount = 2};
    ResourceId resourceId2 = client.OrdersApi.OrderNumbers(request2);
}

}

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X POST -d ' { "numbers":[ "12131234567", "12131234568" ] }' "https://api.callfire.com/v2/orders/numbers"

curl -u "username:password" -H "Content-Type:application/json" -X POST -d ' { "localCount":"2", "zipcode":"90401" }' "https://api.callfire.com/v2/orders/numbers"

Example Response

                    
                      

{ "id": 10 }

Find a specific order get

Returns a single NumberOrder instance for a given order id. Order contains information about purchased keywords, local, toll-free numbers

path

  • https://api.callfire.com/v2/orders/{id} GET

parameters

  • id integer required

    An id of an order

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.account.model.NumberOrder;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("api_login", "api_password"); Long orderId = 123456L; NumberOrder order = callfireClient.ordersApi().getOrder(orderId, "id,status"); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Account.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); const int orderId = 123456; NumberOrder order = client.OrdersApi.GetOrder(orderId); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/orders/10"

Example Response

                    
                      

{ "id": 10, "status": "FINISHED", "created": 1443402092000, "totalCost": 0.0, "localNumbers": { "ordered": 2, "unitCost": 0.0, "fulfilled": [ "13102305724", "13102306096" ] } }

Send texts post

Use the /texts API to send individual texts quickly. By default all texts are going out from CallFire's dedicated short code 67076

path

  • https://api.callfire.com/v2/texts POST

parameters

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

  • campaignId integer

    Specifies a campaignId to send texts through a previously created campaign

  • defaultMessage string

    Text message can be overridden by TextRecipient.message field. If multiple recipients have the same text message to a different recipients it is better to specify a single default message and do not duplicate it in each recipient.

  • body {...} list of ref

    List of TextRecipient

  • attributes object

    A map of string attributes associated with a recipient

  • contactId integer

    An id of existing contact in account

  • media array

    A list of media objects' ids associated with a text message

  • message string

    A text message

  • phoneNumber string

    Phone number in E.164 format (11-digit) or short code. Example: 12132000384, 67076

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.callstexts.model.Text; import com.callfire.api.client.api.campaigns.model.TextRecipient;

import java.util.Arrays; import java.util.List;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password");

    TextRecipient r1 = new TextRecipient();
    r1.setPhoneNumber("16502572135");
    r1.setMessage("Hello 1");
    TextRecipient r2 = new TextRecipient();
    r2.setPhoneNumber("16502572008");
    r2.setMessage("Hello 2");
    List<TextRecipient> recipients = Arrays.asList(r1, r2);
    List<Text> texts = client.textsApi().send(recipients);

    // in case you have multiple recipients with the same text you can use defaultMessage param to specify 
    // text once for all recipients
    // SendTextsRequest request = SendTextsRequest.create()
    //    .recipients(recipients)
    // limit returned fields if needed
    //    .fields("items(id,fromNumber,state)")
    //    .defaultMessage("defaultMessage")
    //    .build();
    //List<Text> texts = client.textsApi().send(request);
}

}

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.CallsTexts.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var recipient1 = new TextRecipient { Message = "msg 1", PhoneNumber = "12132212384" }; var recipient2 = new TextRecipient { Message = "msg 2", PhoneNumber = "12132212399" }; IList texts = client.TextsApi.Send(new List {recipient1, recipient2});

    // in case you have multiple recipients with the same text you can use defaultMessage param to specify 
    // text once for all recipients
    //
    // var recipient1 = new TextRecipient { Message = "msg", PhoneNumber = "12132212384" };
    // var recipient2 = new TextRecipient { Message = "msg", PhoneNumber = "12132212384" };
    // var recipients = new List<TextRecipient> { recipient1, recipient2 };
    // var request = new SendTextsRequest
    // {
    //    Recipients = recipients,
    //    CampaignId = 7415135003,
    //    DefaultMessage = "Hello!",
    //    // limit returned fields if needed
    //    Fields = "items(id,fromNumber,state)"
    // };
    // IList<Text> texts = Client.TextsApi.Send(request);
}

}

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST -d ' [ { "phoneNumber":"12135551100", "message":"Hello World!" }, { "phoneNumber":"12135551101", "message":"Testing 1 2 3" } ]' "https://api.callfire.com/v2/texts"

Example Response

                    
                      

{ "items": [ { "id": 13413, "fromNumber": "67076", "toNumber": "12135551100", "state": "READY", "campaignId": 20, "batchId": 14, "contact": { "id": 4096, "homePhone": "12135551100" }, "inbound": false, "created": 1443403042000, "modified": 1443403042000, "message": "Hello World!" }, { "id": 13414, "fromNumber": "67076", "toNumber": "12135551101", "state": "READY", "campaignId": 20, "batchId": 14, "contact": { "id": 4097, "homePhone": "12135551101" }, "inbound": false, "created": 1443403044000, "modified": 1443403044000, "message": "Testing 1 2 3" } ] }

Find texts get

Searches for texts sent or received by user. Use "id=0" for the campaignId parameter to query for all texts sent through the POST /texts API. See call states and results

path

  • https://api.callfire.com/v2/texts GET

parameters

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

  • limit integer

    To set the maximum number of records to return in a paged list response. The default is 100

  • offset integer

    Offset to the start of a given page. The default is 0. Check [pagination](https://developers.callfire.com/docs.html#pagination) page for more information about pagination in CallFire API.

  • id array

    List of Text ids to search for, if ids specified other query params ignored

  • campaignId integer

    An id of a campaign, queries for texts inside a particular campaign. Specify null to list texts of all campaigns or 0 for a default campaign

  • batchId integer

    An Id of a contact batch, queries for texts which are used in the particular contact batch

  • fromNumber string

    A phone number in E.164 format (11-digit). Example: 12132000384, 67076

  • toNumber string

    A phone number in E.164 format (11-digit). Example: 12132000384, 67076

  • label string

    A label of a text message

  • states string

    Expected text statuses in comma separated string, available values: READY, SELECTED, CALLBACK, FINISHED, DISABLED, DNC, DUP, INVALID, TIMEOUT, PERIOD_LIMIT. See [call states and results](https://developers.callfire.com/results-responses-errors.html)

  • results string

    Expected text results in comma separated string, available values: SENT, RECEIVED, DNT, TOO_BIG, INTERNAL_ERROR, CARRIER_ERROR, CARRIER_TEMP_ERROR, UNDIALED. See [call states and results](https://developers.callfire.com/results-responses-errors.html)

  • inbound boolean

    Specify true for inbound or false for outbounds. Do not specify this parameter if you need to get both inbound and outbound texts listed in response

  • intervalBegin integer

    Start of the find time interval, formatted in unix time milliseconds. Example: 1473781817000

  • intervalEnd integer

    End of the find time interval, formatted in unix time milliseconds. Example: 1473781817000

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.callstexts.model.Text; import com.callfire.api.client.api.callstexts.model.request.FindTextsRequest; import com.callfire.api.client.api.common.model.Page;

import java.util.Arrays;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); FindTextsRequest request = FindTextsRequest.create() .id(Arrays.asList(600537356003L)) .campaignId(7415225003L) .fromNumber("16502572135") .toNumber("16505044730") .build(); Page texts = client.textsApi().find(request); } }

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.CallsTexts.Model; using CallfireApiClient.Api.CallsTexts.Model.Request; using CallfireApiClient.Api.Common.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new FindTextsRequest { States = new List {StateType.FINISHED, StateType.READY}, Results = new List {TextRecord.TextResult.SENT, TextRecord.TextResult.RECEIVED}, Limit = 2 }; Page texts = client.TextsApi.Find(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/texts?limit=2"

Example Response

                    
                      

{ "items": [ { "id": 13405, "fromNumber": "12135551100", "toNumber": "12135551123", "state": "READY", "campaignId": 13, "batchId": 11, "contact": { "id": 4101, "homePhone": "12135551123" }, "inbound": true, "created": 1443382358000, "modified": 1443382358000, "message": "a new test message" }, { "id": 13404, "fromNumber": "12135551100", "toNumber": "12135551122", "state": "READY", "campaignId": 13, "batchId": 10, "contact": { "id": 4099, "homePhone": "12135551122" }, "inbound": true, "created": 1443382248000, "modified": 1443382248000, "message": "a new test message" } ], "limit": 2, "offset": 0, "totalCount": 4107 }

Create an auto reply post

CallFire gives you possibility to set up auto reply messages for your numbers and keywords. You can set a general auto reply for anyone who texts your number, keyword, and/or include a text to match, so that the auto reply would be sent only to those who text the matched text

path

  • https://api.callfire.com/v2/texts/auto-replys POST

parameters

  • body {...} ref

    TextAutoReply

  • id integer

    An id of a text auto reply

  • keyword string

    Setup autoreply for a given keyword

  • match string

    Text to match. If it is set then autoreply will be sent to a person who texted message with matched text. Case insensitive, if parameter is not specified then all texts will be matched

  • message string

    A text message to return as an auto reply

  • number string

    Setup autoreply for a given phone number, E.164 format (11-digit). Example: 12132000384

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.TextAutoReply; import com.callfire.api.client.api.common.model.ResourceId;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); TextAutoReply textAutoReply = new TextAutoReply(); textAutoReply.setNumber("12132226464"); textAutoReply.setMessage("test message"); textAutoReply.setMatch("vacation"); ResourceId resourceId = client.textAutoRepliesApi().create(textAutoReply); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Campaigns.Model; using CallfireApiClient.Api.Common.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var textAutoReply = new TextAutoReply() { Number = "19206596476", Message = "test message", Match = "test match" }; ResourceId resourceId = client.TextAutoRepliesApi.Create(textAutoReply); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST -d ' { "number":"67076", "keyword":"CALLFIRE", "message":"I am a leaf on the wind" }' "https://api.callfire.com/v2/texts/auto-replys"

Example Response

                    
                      

{ "id": 15 }

Find auto replies get

Find all text autoreplies created by user. Returns a paged list of TextAutoReply

path

  • https://api.callfire.com/v2/texts/auto-replys GET

parameters

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

  • limit integer

    To set the maximum number of records to return in a paged list response. The default is 100

  • offset integer

    Offset to the start of a given page. The default is 0. Check [pagination](https://developers.callfire.com/docs.html#pagination) page for more information about pagination in CallFire API.

  • number string

    Phone number in E.164 format (11-digit) which contains a TextAutoReply. Example: 12132000384. If number is empty then operator returns all autoreplies configured for the user's account

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.TextAutoReply; import com.callfire.api.client.api.campaigns.model.request.FindTextAutoRepliesRequest; import com.callfire.api.client.api.common.model.Page;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); FindTextAutoRepliesRequest request = FindTextAutoRepliesRequest.create() .number("12132226464") .build(); Page textAutoReplies = client.textAutoRepliesApi().find(request); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Campaigns.Model; using CallfireApiClient.Api.Campaigns.Model.Request; using CallfireApiClient.Api.Common.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new FindTextAutoRepliesRequest { Number = "19206596476" }; Page autoReplies = client.TextAutoRepliesApi.Find(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/texts/auto-replys"

Example Response

                    
                      

{ "items": [ { "id": 4, "match": ".*", "message": "Short code reply. Echo - ${text.message}!" }, { "id": 15, "number": "67076", "keyword": "CALLFIRE", "message": "I am a leaf on the wind" } ], "limit": 100, "offset": 0, "totalCount": 2 }

Find a specific auto reply get

Returns a single TextAutoReply instance for a given text auto reply id

path

  • https://api.callfire.com/v2/texts/auto-replys/{id} GET

parameters

  • id integer required

    An id of a text auto reply

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.TextAutoReply;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); TextAutoReply textAutoReply = client.textAutoRepliesApi().get(12345L); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Campaigns.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); TextAutoReply autoReply = client.TextAutoRepliesApi.Get(123456); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/texts/auto-replys/15?fields=id,keyword,message"

Example Response

                    
                      

{ "id": 15, "keyword": "CALLFIRE", "message": "I am a leaf on the wind" }

Delete an auto reply delete

Deletes a text auto reply and removes the configuration. Can not delete a TextAutoReply which is currently active for a campaign

path

  • https://api.callfire.com/v2/texts/auto-replys/{id} DELETE

parameters

  • id integer required

    An id of a text auto reply

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); client.textAutoRepliesApi().delete(12345L); } }

Sample Code

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); client.TextAutoRepliesApi.Delete(123456); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X DELETE "https://api.callfire.com/v2/texts/auto-replys/15"

Example Response

                    
                      

204 - No Content

Create a text broadcast post

Creates a text broadcast campaign using the Text Broadcast API. Send a TextBroadcast object in the message body to detail a text broadcast campaign. A campaign can be created without contacts and with bare minimum configuration, but contacts have to be added further on to use the campaign. It supports scheduling, retry logic, pattern-based messages.

path

  • https://api.callfire.com/v2/texts/broadcasts POST

parameters

  • start boolean

    If true then starts the campaign immediately (not required).

  • body {...} ref

    TextBroadcast

  • bigMessageStrategy string

    If message length exceeds 160 characters, multiple messages will be sent, SEND_MULTIPLE strategy is chosen by default. Available values: SEND_MULTIPLE - send text as multiple messages, DO_NOT_SEND - do not send text if it exceeds 160 characters, TRIM - trims text message to 160 characters

  • fromNumber string

    A phone number in E.164 format (11-digit) or short code. Example: 12132000384, 67076, etc

  • id integer

    A unique id of a broadcast

  • labels array

    A labels of a broadcast

  • lastModified integer

    A time when the given resource was updated, formatted in unix time milliseconds (read only). Example: 1473781817000

  • localTimeRestriction ref

    Specifies a range of time when Callfire sends a text to recipients. Please note that a range of time applies to recipient's timezone

  • maxActive integer

    A maximum number of calls that CallFire dials at once

  • media array

    ~

  • message string

    A text message

  • name string

    A name of a broadcast

  • recipients array

    Recipients of a text campaign, can be an existing contacts or a new one

  • resumeNextDay boolean

    ~

  • schedules array

    ~

  • status string

    A status of a broadcast. SETUP - campaign isn't configured yet; START_PENDING - waiting for contact batch population; RUNNING - campaign is running; STOPPED - campaign is stopped; FINISHED - campaign is finished; ARCHIVED - campaign was archived

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.LocalTimeRestriction; import com.callfire.api.client.api.campaigns.model.TextBroadcast; import com.callfire.api.client.api.campaigns.model.TextRecipient; import com.callfire.api.client.api.common.model.ResourceId;

import java.util.Arrays;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password");

    TextBroadcast broadcast = new TextBroadcast();
    broadcast.setName("Charity SMS Campaign");
    // attach custom labels if needed
    broadcast.setLabels(Arrays.asList("charity", "id-10002"));
    // You can use default shared short code 67076 or uncomment the next line and set your own number
    // broadcast.setFromNumber("12131234567");

    // allow CallFire to send text to recipients only between 09:00 - 18:00 depending on
    //  recipient's number area code timezone
    LocalTimeRestriction timeRestriction = new LocalTimeRestriction();
    timeRestriction.setBeginHour(9);
    timeRestriction.setBeginMinute(0);
    timeRestriction.setEndHour(18);
    timeRestriction.setEndMinute(0);
    broadcast.setLocalTimeRestriction(timeRestriction);

    // by default if text exceeds length of 160 characters, CallFire will send a text as multiple messages.
    // broadcast.setBigMessageStrategy(TextBroadcast.BigMessageStrategy.TRIM);
    broadcast.setMessage("Hello {u_name}, Missing for a great event ? We invite you to participate in a "
        + "charity fair which takes place at first Saturday of November. You can order tickets by calling us: "
        + "855-555-5555. We are looking forward to meet you there");

    // add new recipients
    TextRecipient recipient1 = new TextRecipient();
    recipient1.setPhoneNumber("13233834422");
    // set custom recipient attributes, they are available only to a single Call/Text
    //  action, do not confuse them with contact fields which are stored with contact and are available to
    //  each Call/Text where contact is attached to
    recipient1.getAttributes().put("u_name", "Alice");
    recipient1.getAttributes().put("age", "30");

    TextRecipient recipient2 = new TextRecipient();
    recipient2.setPhoneNumber("12135551101");
    recipient2.getAttributes().put("u_name", "Mark");
    recipient2.getAttributes().put("age", "45");

    TextRecipient recipient3 = new TextRecipient();
    recipient3.setPhoneNumber("13233834488");
    // You can override a message set in broadcast for a particular recipient
    recipient3.setMessage("Hi {u_name}, the megic number is ${magic_number}");
    // Set custom attribute
    recipient2.getAttributes().put("u_name", "Jane");
    recipient2.getAttributes().put("magic_number", "10");
    recipient3.getAttributes().put("call_label", "friends");

    broadcast.setRecipients(Arrays.asList(recipient1, recipient2, recipient3));

    // create broadcast and start immediately
    ResourceId id = client.textBroadcastsApi().create(broadcast, true);
}

}

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.CallsTexts.Model; using CallfireApiClient.Api.Campaigns.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var broadcast = new TextBroadcast { Name = "Charity Campaign", // set validated Caller ID number. FromNumber = "12135551189", // attach custom labels if needed Labels = new List {"charity", "id-10002"}, // allow CallFire to send out a message to recipient only between 09:00 - 18:00 depending on // recipient's number area code timezone LocalTimeRestriction = new LocalTimeRestriction { BeginHour = 9, BeginMinute = 0, EndHour = 18, EndMinute = 0 },

        // set message text
        Message = @"
            Hello ${u_name}. Missing for a great event ?
            We invite you to participate in a charity fair which takes place at first Saturday of November. You can order
            tickets by calling us: 855-555-5555. We are looking forward to meet you there
        ",
        // add new recipients
        Recipients = new List<TextRecipient>
        {
            new TextRecipient
            {
                PhoneNumber = "12135551100",
                // set custom recipient attributes, they are available only to a single Call/Text
                //  action, do not confuse them with contact fields which are stored with contact
                //  and are available to each Call/Text where contact is attached to
                Attributes = new Dictionary<string, string>
                {
                    {"u_name", "Alice"},
                    {"age", "30"}
                }
            },
            new TextRecipient
            {
                PhoneNumber = "12135551101",
                Attributes = new Dictionary<string, string>
                {
                    {"u_name", "Mark"}
                }
            },
            new TextRecipient
            {
                PhoneNumber = "12135551101",
                // you can override a message set in broadcast for a particular recipient
                Message = "Hi ${u_name}, the megic number is ${magic_number}",
                Attributes = new Dictionary<string, string>
                {
                    {"u_name", "Jane"},
                    {"magic_number", "10"}
                }
            }
        }
    };

    // create broadcast with 'start' argument = true to start campaign immediately
    var id = client.TextBroadcastsApi.Create(broadcast, true);
}

}

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST -d ' { "name":"Charity SMS Campaign", "labels": [ "charity", "id-10003" ], "fromNumber":"19206596476", "recipients":[ { "phoneNumber":"13233834422", "attributes": { "u_name": "Alice", "age": 30 } }, { "phoneNumber":"13233834433", "attributes": { "u_name": "Mark", "age": 45 } }, { "phoneNumber":"13233834488", "message": "Hi ${u_name}, the megic number is ${magic_number}" "attributes": { "u_name": "Jane", "magic_number": "10" } } ], "message":"Hello {u_name}, Missing for a great event ? We invite you to participate in a charity fair which takes place at first Saturday of November. You can order tickets by calling us: 855-555-5555. We are looking forward to meet you there" }' "https://api.callfire.com/v2/texts/broadcasts"

Example Response

                    
                      

{ "id": 13 }

Find text broadcasts get

Searches for all text broadcasts created by user. Can query on label, name, and the current running status of the campaign. Returns a paged list of text broadcasts

path

  • https://api.callfire.com/v2/texts/broadcasts GET

parameters

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

  • limit integer

    To set the maximum number of records to return in a paged list response. The default is 100

  • offset integer

    Offset to the start of a given page. The default is 0. Check [pagination](https://developers.callfire.com/docs.html#pagination) page for more information about pagination in CallFire API.

  • label string

    A label of a text broadcast

  • name string

    A name of text broadcast

  • running boolean

    Returns broadcasts only in running state.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.TextBroadcast; import com.callfire.api.client.api.campaigns.model.request.FindTextBroadcastsRequest; import com.callfire.api.client.api.common.model.Page;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); FindTextBroadcastsRequest request = FindTextBroadcastsRequest.create() .name("campaign") .limit(2L) .build(); Page broadcasts = client.textBroadcastsApi().find(request); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Campaigns.Model; using CallfireApiClient.Api.Campaigns.Model.Request; using CallfireApiClient.Api.Common.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new FindBroadcastsRequest { Name = "campaign name", Limit = 1 }; Page broadcasts = client.TextBroadcastsApi.Find(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/texts/broadcasts"

Example Response

                    
                      

{ "items": [ { "id": 3, "name": "Outbound SMS Broadcast", "status": "FINISHED", "lastModified": 1443333295000, "fromNumber": "67076", "localTimeRestriction": { "enabled": false }, "retryConfig": { "maxAttempts": 1, "minutesBetweenAttempts": 60, "retryPhoneTypes": [ "FIRST_NUMBER" ] }, "message": "This is a text broadcast", "bigMessageStrategy": "DO_NOT_SEND", "resumeNextDay": true }, { "id": 13, "name": "Example API SMS", "status": "STOPPED", "lastModified": 1443380774000, "fromNumber": "12135551100", "localTimeRestriction": { "enabled": false }, "retryConfig": { "maxAttempts": 1, "minutesBetweenAttempts": 60, "retryPhoneTypes": [ "FIRST_NUMBER" ] }, "message": "Hello World!", "resumeNextDay": true } ], "totalCount": 2 }

Find a specific text broadcast get

Returns a single TextBroadcast instance for a given text broadcast id

path

  • https://api.callfire.com/v2/texts/broadcasts/{id} GET

parameters

  • id integer required

    An id of a text broadcast

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.TextBroadcast;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); TextBroadcast broadcast = client.textBroadcastsApi().get(123L); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Campaigns.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); TextBroadcast broadcast = client.TextBroadcastsApi.Get(123456); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/texts/broadcasts/13"

Example Response

                    
                      

{ "id": 13, "name": "Example API SMS", "status": "STOPPED", "lastModified": 1443380774000, "fromNumber": "12135551100", "localTimeRestriction": { "enabled": false }, "retryConfig": { "maxAttempts": 1, "minutesBetweenAttempts": 60, "retryPhoneTypes": [ "FIRST_NUMBER" ] }, "message": "Hello World!", "resumeNextDay": true }

Update a text broadcast put

Allows modifying the configuration of existing text broadcast campaign. See TextBroadcast for more information on what can/can't be updated on this API

path

  • https://api.callfire.com/v2/texts/broadcasts/{id} PUT

parameters

  • id integer required

    An id of a text broadcast

  • body {...} ref

    TextBroadcast

  • bigMessageStrategy string

    If message length exceeds 160 characters, multiple messages will be sent, SEND_MULTIPLE strategy is chosen by default. Available values: SEND_MULTIPLE - send text as multiple messages, DO_NOT_SEND - do not send text if it exceeds 160 characters, TRIM - trims text message to 160 characters

  • fromNumber string

    A phone number in E.164 format (11-digit) or short code. Example: 12132000384, 67076, etc

  • id integer

    A unique id of a broadcast

  • labels array

    A labels of a broadcast

  • lastModified integer

    A time when the given resource was updated, formatted in unix time milliseconds (read only). Example: 1473781817000

  • localTimeRestriction ref

    Specifies a range of time when Callfire sends a text to recipients. Please note that a range of time applies to recipient's timezone

  • maxActive integer

    A maximum number of calls that CallFire dials at once

  • media array

    ~

  • message string

    A text message

  • name string

    A name of a broadcast

  • recipients array

    Recipients of a text campaign, can be an existing contacts or a new one

  • resumeNextDay boolean

    ~

  • schedules array

    ~

  • status string

    A status of a broadcast. SETUP - campaign isn't configured yet; START_PENDING - waiting for contact batch population; RUNNING - campaign is running; STOPPED - campaign is stopped; FINISHED - campaign is finished; ARCHIVED - campaign was archived

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.TextBroadcast;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password");

    TextBroadcast broadcast = client.textBroadcastsApi().get(123L);
    broadcast.setName("New name");
    client.textBroadcastsApi().update(broadcast);
}

}

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Campaigns.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var broadcast = client.TextBroadcastsApi.Get(123456); broadcast.Name = "New name"; broadcast.FromNumber = "67076"; broadcast.BigMessageStrategy = BigMessageStrategy.DO_NOT_SEND; // update campaign client.TextBroadcastsApi.Update(broadcast); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X PUT -d ' { "name":"Example API SMS updated", "message":"a new test message" }' "https://api.callfire.com/v2/texts/broadcasts/13"

Example Response

                    
                      

200 OK - No Response

Archive text broadcast post

Archives a text broadcast (and hides it in the search results)

path

  • https://api.callfire.com/v2/texts/broadcasts/{id}/archive POST

parameters

  • id integer required

    An id of a text broadcast to archive

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); client.textBroadcastsApi().archive(123L); } }

Sample Code

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); client.TextBroadcastsApi.Archive(123456); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST "https://api.callfire.com/v2/texts/broadcasts/15/archive"

Example Response

                    
                      

200 OK - No Response

Add batches to a text broadcast post

Allows adding an extra batches to an already created text broadcast campaign. The batches which being added pass the CallFire validation process (unlike in the recipients version of this API). That is why using of a scrubDuplicates flag remove duplicates from your batch. Batches may be added as a contact list id, a list of contact ids, or a list of numbers

path

  • https://api.callfire.com/v2/texts/broadcasts/{id}/batches POST

parameters

  • id integer required

    An id of a text broadcast

  • body {...} ref

    BatchRequest

  • contactListId integer

    An id of existing contact list

  • name string

    A name of batch

  • recipients array

    A list of Recipient objects. For each recipient you can set its phone number or existing contact id to use contact which already exists in account

  • scrubDuplicates boolean

    Removes duplicate recipients from batch if true

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.Recipient; import com.callfire.api.client.api.campaigns.model.request.AddBatchRequest; import com.callfire.api.client.api.common.model.ResourceId;

import java.util.Arrays;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password");

    Recipient recipient1 = new Recipient();
    recipient1.setPhoneNumber("12131234567");
    Recipient recipient2 = new Recipient();
    recipient2.setPhoneNumber("12131234568");
    AddBatchRequest request = AddBatchRequest.create()
        .campaignId(123456L)
        .name("new_batch")
        .recipients(Arrays.asList(recipient1, recipient2))
        .build();
    ResourceId resourceId = client.textBroadcastsApi().addBatch(request);
}

}

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.CallsTexts.Model; using CallfireApiClient.Api.Campaigns.Model; using CallfireApiClient.Api.Campaigns.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new AddBatchRequest { CampaignId = 123456, Name = "new_batch", Recipients = new List { new TextRecipient {PhoneNumber = "12132212384"}, new TextRecipient {PhoneNumber = "12132212385"} } }; var resourceId = client.TextBroadcastsApi.AddBatch(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST -d ' { "name":"contact batch for text", "recipients": [ { "phoneNumber":"12135551122" } ], "scrubDuplicates":"true" }' "https://api.callfire.com/v2/texts/broadcasts/13/batches"

Example Response

                    
                      

{ "id": 10 }

Find batches in a text broadcast get

This endpoint will enable the user to page through all of the batches for a particular text broadcast campaign

path

  • https://api.callfire.com/v2/texts/broadcasts/{id}/batches GET

parameters

  • id integer required

    An id of a text broadcast

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

  • limit integer

    To set the maximum number of records to return in a paged list response. The default is 100

  • offset integer

    Offset to the start of a given page. The default is 0. Check [pagination](https://developers.callfire.com/docs.html#pagination) page for more information about pagination in CallFire API.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.Batch; import com.callfire.api.client.api.common.model.Page; import com.callfire.api.client.api.common.model.request.GetByIdRequest;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); GetByIdRequest request = GetByIdRequest.create() .id(1234L) .limit(10L) .build(); Page batches = client.textBroadcastsApi().getBatches(request); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Common.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new GetByIdRequest { Id = 123456, Limit = 10 }; var batches = client.TextBroadcastsApi.GetBatches(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/texts/broadcasts/13/batches"

Example Response

                    
                      

{ "items": [ { "id": 9, "name": "API 13", "status": "ACTIVE", "broadcastId": 13, "created": 1443380774000, "size": 2, "remaining": 2, "enabled": true } ], "limit": 100, "offset": 0, "totalCount": 1 }

Add recipients to a text broadcast post

Use this API to add recipients to a text broadcast which is already created. Post a list of Recipient objects to be immediately added to the text broadcast campaign. These contacts will not go through validation process, and will be acted upon as they are added. Recipients may be added as a list of contact ids, or list of numbers

path

  • https://api.callfire.com/v2/texts/broadcasts/{id}/recipients POST

parameters

  • id integer required

    An id of a text broadcast

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

  • body {...} list of ref

    List of TextRecipient

  • attributes object

    A map of string attributes associated with a recipient

  • contactId integer

    An id of existing contact in account

  • media array

    A list of media objects' ids associated with a text message

  • message string

    A text message

  • phoneNumber string

    Phone number in E.164 format (11-digit) or short code. Example: 12132000384, 67076

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.callstexts.model.Text; import com.callfire.api.client.api.campaigns.model.TextRecipient;

import java.util.Arrays; import java.util.List;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); TextRecipient recipient1 = new TextRecipient(); recipient1.setPhoneNumber("12131234567"); TextRecipient recipient2 = new TextRecipient(); recipient2.setPhoneNumber("12131234568"); List texts = client.textBroadcastsApi().addRecipients(123456L, Arrays.asList(recipient1, recipient2)); } }

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.CallsTexts.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var recipients = new List { new TextRecipient {PhoneNumber = "12132212384"}, new TextRecipient {PhoneNumber = "12132212385"} }; var texts = client.TextBroadcastsApi.AddRecipients(123456, recipients); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST -d ' [ { "phoneNumber":"12135551123" } ]' "https://api.callfire.com/v2/texts/broadcasts/13/recipients"

Example Response

                    
                      

{ "items": [ { "id": 13405, "fromNumber": "12135551100", "toNumber": "12135551123", "state": "READY", "campaignId": 13, "batchId": 11, "contact": { "id": 4101, "homePhone": "12135551123" }, "inbound": false, "created": 1443382358000, "modified": 1443382358000, "message": "a new test message" } ] }

Start text broadcast post

Starts a text broadcast

path

  • https://api.callfire.com/v2/texts/broadcasts/{id}/start POST

parameters

  • id integer required

    An id of a text broadcast to start

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); client.textBroadcastsApi().start(123L); } }

Sample Code

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); client.TextBroadcastsApi.Start(123456); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST "https://api.callfire.com/v2/texts/broadcasts/15/start"

Example Response

                    
                      

200 OK - No Response

Get statistics on text broadcast get

Returns the broadcast statistics. Example: total number of the sent/received actions, total cost, number of remaining outbound actions, error count, etc

path

  • https://api.callfire.com/v2/texts/broadcasts/{id}/stats GET

parameters

  • id integer required

    An id of a text broadcast

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

  • begin integer

    Start of a search find time interval, formatted in unix time milliseconds. Example: 1473781817000 for Sat, 05 Jan 1985 14:03:37 GMT

  • end integer

    End of a search time interval, formatted in unix time milliseconds. Example: 1473781817000 for Sat, 05 Jan 1985 14:03:37 GMT

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.campaigns.model.TextBroadcastStats; import org.apache.commons.lang3.time.DateUtils;

import java.util.Date;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); Date end = new Date(); Date begin = DateUtils.addDays(end, -5); // limit returned fields if needed String fields = "callsAttempted,callsPlaced,callsDuration"; TextBroadcastStats stats = client.textBroadcastsApi().getStats(8624192003L, fields, begin, end); } }

Sample Code

              
                

using System; using CallfireApiClient; using CallfireApiClient.Api.Campaigns.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var begin = DateTime.Now.AddDays(-5d); var end = DateTime.Now; BroadcastStats stats = client.TextBroadcastsApi.GetStats(8624192003L, null, begin, end); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/texts/broadcasts/13/stats"

Example Response

                    
                      

{ "totalOutboundCount": 2, "remainingOutboundCount": 0, "billedAmount": 0.50, "sentCount": 2, "unsentCount": 0, "recievedCount": 1, "doNotTextCount": 1, "tooBigCount": 0, "errorCount": 0 }

Stop text broadcast post

Stops a text broadcast

path

  • https://api.callfire.com/v2/texts/broadcasts/{id}/stop POST

parameters

  • id integer required

    An Id of a text broadcast. To stop the broadcast

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); client.textBroadcastsApi().stop(123L); } }

Sample Code

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); client.TextBroadcastsApi.Stop(123456); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST "https://api.callfire.com/v2/texts/broadcasts/15/stop"

Example Response

                    
                      

200 OK - No Response

Find texts in a text broadcast get

This endpoint will enable the user to page through all of the texts for a particular text broadcast campaign

path

  • https://api.callfire.com/v2/texts/broadcasts/{id}/texts GET

parameters

  • id integer required

    An id of a text broadcast

  • batchId integer

    ~

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

  • limit integer

    To set the maximum number of records to return in a paged list response. The default is 100

  • offset integer

    Offset to the start of a given page. The default is 0. Check [pagination](https://developers.callfire.com/docs.html#pagination) page for more information about pagination in CallFire API.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.callstexts.model.Text; import com.callfire.api.client.api.campaigns.model.request.FindBroadcastTextsRequest; import com.callfire.api.client.api.common.model.Page;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); FindBroadcastTextsRequest request = FindBroadcastTextsRequest.create() .id(1234L) .build(); Page texts = client.textBroadcastsApi().findTexts(request); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Common.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new GetByIdRequest { Id = 123456, Limit = 10 }; var texts = client.TextBroadcastsApi.GetTexts(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/texts/broadcasts/13/texts"

Example Response

                    
                      

{ "items": [ { "id": 13405, "fromNumber": "12135551100", "toNumber": "12135551123", "state": "READY", "campaignId": 13, "batchId": 11, "contact": { "id": 4101, "homePhone": "12135551123" }, "inbound": false, "created": 1443382358000, "modified": 1443382358000, "message": "a new test message" }, { "id": 13404, "fromNumber": "12135551100", "toNumber": "12135551122", "state": "READY", "campaignId": 13, "batchId": 10, "contact": { "id": 4099, "homePhone": "12135551122" }, "inbound": false, "created": 1443382248000, "modified": 1443382248000, "message": "a new test message" }, { "id": 13403, "fromNumber": "12135551100", "toNumber": "13233832214", "state": "READY", "campaignId": 13, "batchId": 9, "contact": { "id": 4100, "homePhone": "13233832214" }, "inbound": false, "created": 1443380774000, "modified": 1443380774000, "message": "a new test message" }, { "id": 13402, "fromNumber": "12135551100", "toNumber": "13233832214", "state": "READY", "campaignId": 13, "batchId": 9, "contact": { "id": 4100, "homePhone": "13233832214" }, "inbound": false, "created": 1443380774000, "modified": 1443380774000, "message": "a new test message" } ], "limit": 100, "offset": 0, "totalCount": 4 }

Find a specific text get

Returns a single Text instance for a given text id

path

  • https://api.callfire.com/v2/texts/{id} GET

parameters

  • id integer required

    An id of a text

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.callstexts.model.Text;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); Text text = client.textsApi().get(600537356003L); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.CallsTexts.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); // limit returned fields if needed Text text = client.TextsApi.Get(600537356003, "id,fromNumber,state"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/texts/13405"

Example Response

                    
                      

{ "id": 13413, "fromNumber": "67076", "toNumber": "12135551100", "state": "FINISHED", "campaignId": 20, "batchId": 14, "contact": { "id": 4096, "homePhone": "12135551100" }, "inbound": false, "created": 1443403042000, "modified": 1443403045000, "message": "Hello World!", "finalTextResult": "DNT", "records": [ { "id": 10310, "billedAmount": 0.0, "finishTime": 1443403043000, "message": "Hello World!", "textResult": "DNT" } ] }

Create a webhook post

Create a Webhook for notification in the CallFire system. Use the webhooks API to receive notifications of important CallFire events. Select the resource to listen to, and then choose the resource events to receive notifications on. When an event triggers, a POST will be made to the callback URL with a payload of notification information. Available resources and their events include 'CccCampaign': ['started', 'stopped', 'finished'], 'CallBroadcast': ['started', 'stopped', 'finished'], 'TextBroadcast': ['started', 'stopped', 'finished'], 'OutboundCall': ['finished'], 'InboundCall': ['finished'], 'OutboundText': ['finished'], 'InboundText': ['finished']. Webhooks support secret token which is used as signing key to HmacSHA1 hash of json payload which is returned in 'X-CallFire-Signature' header. This header can be used to verify callback POST is coming from CallFire. See security guide

path

  • https://api.callfire.com/v2/webhooks POST

parameters

  • body {...} ref

    Webhook

  • callback string

    URL that webhook will send POST to on resource event trigger

  • createdAt integer

    A time when the given resource was created, formatted in unix time milliseconds (read only). Example: 1473781817000

  • enabled boolean

    A parameter which allows the webhook to send requests to unknown ssl endpoints (ssl certificate verification is disabled)

  • events array

    Comma separated list of events on resource that will trigger callbacks (ex: STARTED, STOPPED, FINISHED, etc...).

  • fields string

    A limit callback response to a particular fields

  • id integer

    An id of a webhook

  • name string

    A name of a webhook

  • nonStrictSsl boolean

    A parameter which allows the webhook to send requests to unknown ssl endpoints (ssl certificate verification is disabled)

  • resource string

    A resource name that webhook is watching events on. Use GET /webhooks/resources to determine resources and events available (ex: InboundCall, OutboundCall, InboundText, OutboundText, CallBroadcast, TextBroadcast, etc...)

  • secret string

    Webhook secret token which is used as a signing key to HmacSHA1 hash of json payload which is returned in 'X-CallFire-Signature' header. This header can be used to verify callback POST is coming from CallFire. See [security guide](https://developers.callfire.com/security-guide.html)

  • singleUse boolean

    If true is set then webhook triggers only once. Afterwards the webhook will be deleted

  • updatedAt integer

    A time when the given resource was updated, formatted in unix time milliseconds (read only). Example: 1473781817000

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.common.model.ResourceId; import com.callfire.api.client.api.webhooks.model.ResourceType; import com.callfire.api.client.api.webhooks.model.Webhook;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); Webhook webhook = new Webhook(); webhook.setName("new webhook"); webhook.setResource(ResourceType.CALL_BROADCAST); webhook.getEvents().add(ResourceType.ResourceEvent.STARTED); webhook.getEvents().add(ResourceType.ResourceEvent.FINISHED); webhook.setCallback("https://yoursite.com/callback"); ResourceId id = client.webhooksApi().create(webhook); } }

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.Common.Model; using CallfireApiClient.Api.Webhooks.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var webhook = new Webhook { Name = "new webhook", Resource = ResourceType.TEXT_BROADCAST, Events = new HashSet {ResourceEvent.STARTED, ResourceEvent.FINISHED}, Callback = "https://yoursite.com/callback" }; ResourceId resource = client.WebhooksApi.Create(webhook); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST "https://api.callfire.com/v2/webhooks" -d ' { "name":"Sms sent", "resource":"OutboundText", "events":["Finished"], "callback":"https://callback-service.com/listener" }'

Example Response

                    
                      

{ "id": 4321 }

Find webhooks get

Searches all webhooks available for a current user. Searches by name, resource, event, callback URL, or whether they are enabled. Returns a paged list of Webhooks

path

  • https://api.callfire.com/v2/webhooks GET

parameters

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

  • limit integer

    To set the maximum number of records to return in a paged list response. The default is 100

  • offset integer

    Offset to the start of a given page. The default is 0. Check [pagination](https://developers.callfire.com/docs.html#pagination) page for more information about pagination in CallFire API.

  • name string

    A name of a webhook

  • resource string

    A name of a resource, available values: 'CccCampaign', 'CallBroadcast', 'TextBroadcast', 'OutboundCall', 'OutboundText', 'InboundCall', 'InboundText'

  • event string

    A name of event, available values: 'started', 'stopped', 'finished'

  • callback string

    A callback URL

  • enabled boolean

    Specifies whether webhook is enabled

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.common.model.Page; import com.callfire.api.client.api.webhooks.model.Webhook; import com.callfire.api.client.api.webhooks.model.request.FindWebhooksRequest;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); FindWebhooksRequest request = FindWebhooksRequest.create() .limit(5L) .enabled(true) .name("test_name") .build(); Page webhooks = client.webhooksApi().find(request); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Common.Model; using CallfireApiClient.Api.Webhooks.Model; using CallfireApiClient.Api.Webhooks.Model.Request;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new FindWebhooksRequest { Limit = 5, Enabled = true, Name = "test_name" }; Page webhooks = client.WebhooksApi.Find(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/webhooks/"

Example Response

                    
                      

{ "items": [ { "id": 4321, "enabled": false, "name": "API hook", "resource": "TextBroadcast", "events": [ "stop", "start" ], "callback": "https://callfire.com/newText", "createdAt": 1443408255000, "updatedAt": 1443408255000 }, { "id": 2, "enabled": false, "name": "API hook", "resource": "TextBroadcast", "events": [ "stop", "start" ], "callback": "https://www.callfire.com/stoppedTexts", "createdAt": 1443408445000, "updatedAt": 1443408445000 } ], "limit": 1000, "offset": 0, "totalCount": 2 }

Find webhook resources get

Searches for webhook resources. Available resources include 'CccCampaign': ['started', 'stopped', 'finished'], 'CallBroadcast': ['started', 'stopped', 'finished'], 'TextBroadcast': ['started', 'stopped', 'finished'], 'OutboundCall': ['finished'], 'InboundCall': ['finished'], 'OutboundText': ['finished'], 'InboundText': ['finished']

path

  • https://api.callfire.com/v2/webhooks/resources GET

parameters

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.webhooks.WebhooksApi; import com.callfire.api.client.api.webhooks.model.WebhookResource;

import java.util.List;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); WebhooksApi api = client.webhooksApi(); List resources = api.findWebhookResources("items(resource)"); } }

Sample Code

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var resources = client.WebhooksApi.FindWebhookResources(null); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/webhooks/resources"

Example Response

                    
                      

{ "items": [ { "resource": "TextBroadcast", "events": [ "stop", "start" ] }, { "resource": "CallBroadcast", "events": [ "stop", "start" ] } ], "limit": 1000, "offset": 0, "totalCount": 2 }

Find specific webhook resource get

Returns information about supported events for a given webhook resource

path

  • https://api.callfire.com/v2/webhooks/resources/{resource} GET

parameters

  • resource string required

    A name of a webhook resource. Available resources include 'CccCampaign': ['started', 'stopped', 'finished'], 'CallBroadcast': ['started', 'stopped', 'finished'], 'TextBroadcast': ['started', 'stopped', 'finished'], 'OutboundCall': ['finished'], 'InboundCall': ['finished'], 'OutboundText': ['finished'], 'InboundText': ['finished']

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.webhooks.WebhooksApi; import com.callfire.api.client.api.webhooks.model.ResourceType; import com.callfire.api.client.api.webhooks.model.WebhookResource;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); WebhooksApi api = client.webhooksApi(); WebhookResource resource = api.findWebhookResource(ResourceType.CALL_BROADCAST, "resource"); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Webhooks.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var resource = client.WebhooksApi.FindWebhookResource(ResourceType.CALL_BROADCAST, null); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/webhooks/resources/text-broadcast"

Example Response

                    
                      

{ "resource": "TextBroadcast", "events": [ "stop", "start" ] }

Find a specific webhook get

Returns a single Webhook instance for a given webhook id

path

  • https://api.callfire.com/v2/webhooks/{id} GET

parameters

  • id integer required

    An id of a webhook

  • fields string

    Limit fields received in response. E.g. fields: id, name or fields items (id, name), see more at [partial response](https://developers.callfire.com/docs.html#partial-response) page.

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.webhooks.model.Webhook;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); Webhook webhook = client.webhooksApi().get(12345678L, "id,name,created"); } }

Sample Code

              
                

using CallfireApiClient; using CallfireApiClient.Api.Webhooks.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); Webhook webhook = client.WebhooksApi.Get(12345678); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/webhooks/4321"

Example Response

                    
                      

{ "id": 4321, "enabled": false, "name": "API hook", "resource": "TextBroadcast", "events": [ "stop", "start" ], "callback": "http://webhook.receiver.xyz/endpoint", "createdAt": 1443408255000, "updatedAt": 1443408255000 }

Delete a webhook delete

Deletes a webhook instance. Will be removed permanently

path

  • https://api.callfire.com/v2/webhooks/{id} DELETE

parameters

  • id integer required

    An Id of a webhook

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); client.webhooksApi().delete(12345678L); } }

Sample Code

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); client.WebhooksApi.Delete(12345678); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X DELETE "https://api.callfire.com/v2/webhooks/1/"

Example Response

                    
                      

204 - No Content

Update a webhook put

Updates the information in existing webhook

path

  • https://api.callfire.com/v2/webhooks/{id} PUT

parameters

  • id integer required

    An id of a webhook

  • body {...} ref

    Webhook

  • callback string

    URL that webhook will send POST to on resource event trigger

  • createdAt integer

    A time when the given resource was created, formatted in unix time milliseconds (read only). Example: 1473781817000

  • enabled boolean

    A parameter which allows the webhook to send requests to unknown ssl endpoints (ssl certificate verification is disabled)

  • events array

    Comma separated list of events on resource that will trigger callbacks (ex: STARTED, STOPPED, FINISHED, etc...).

  • fields string

    A limit callback response to a particular fields

  • id integer

    An id of a webhook

  • name string

    A name of a webhook

  • nonStrictSsl boolean

    A parameter which allows the webhook to send requests to unknown ssl endpoints (ssl certificate verification is disabled)

  • resource string

    A resource name that webhook is watching events on. Use GET /webhooks/resources to determine resources and events available (ex: InboundCall, OutboundCall, InboundText, OutboundText, CallBroadcast, TextBroadcast, etc...)

  • secret string

    Webhook secret token which is used as a signing key to HmacSHA1 hash of json payload which is returned in 'X-CallFire-Signature' header. This header can be used to verify callback POST is coming from CallFire. See [security guide](https://developers.callfire.com/security-guide.html)

  • singleUse boolean

    If true is set then webhook triggers only once. Afterwards the webhook will be deleted

  • updatedAt integer

    A time when the given resource was updated, formatted in unix time milliseconds (read only). Example: 1473781817000

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.webhooks.model.ResourceType; import com.callfire.api.client.api.webhooks.model.Webhook;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api login", "api password"); Webhook webhook = client.webhooksApi().get(12345678L); webhook.setName("new webhook"); webhook.setResource(ResourceType.CALL_BROADCAST); webhook.getEvents().add(ResourceType.ResourceEvent.STARTED); webhook.getEvents().add(ResourceType.ResourceEvent.FINISHED); webhook.setCallback("https://yoursite.com/callback"); client.webhooksApi().update(webhook); } }

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.Webhooks.Model;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var webhook = new Webhook { Id = 12345678, Name = "new webhook", Resource = ResourceType.TEXT_BROADCAST, Events = new HashSet { ResourceEvent.STARTED, ResourceEvent.FINISHED }, Callback = "https://yoursite.com/callback" }; client.WebhooksApi.Update(webhook); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X PUT "https://api.callfire.com/v2/webhooks/1/" -d ' { "name":"API hook", "resource":"textCampaign", "events":["stop"], "callback":"https://callfire.com/stopTextsOnly" }'

Example Response

                    
                      

200 OK - No Response