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:

NOTE: Authentication credentials should be base64 encoded

Authorization: Basic YTYzNDNjYzRlZGQ2OmMyZDc3ZWVjNGFhM2UyMjQ=

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

Example Header

Authorization: Basic YTYzNDNjYzRlZGQ2OmMyZDc3ZWVjNGFhM2UyMjQ=

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. Example: fields=totalCount will return only totalCount value.

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
      }
    }
  ],
  "limit": 50,
  "offset": 200,
  "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

  • strictValidation boolean

    Turns on strict validation for recipients. System will reply with BAD_REQUEST(400) if strictValidation = true and one of numbers didn't pass validation

  • 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)

  • fromNumber string

    ~

  • 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

              
                

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

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

    var request = new SendCallsRequest()
    {
        DefaultVoice = Voice.MALE1,
        Fields = "items(id,state,toNumber)",
        CampaignId = 4050600003,
        Recipients = new List<CallRecipient>
        {
            new CallRecipient
            {
                PhoneNumber = "12135551100",
                LiveMessage = "Hello, Alice, this is message for live answer",
                MachineMessage = "Hello, Alice, this is message for answering machine"
            },
            new CallRecipient
            {
                PhoneNumber = "12135551101",
                LiveMessage = "Hello, Bob, this is message for live answer",
                MachineMessage = "Hello, Bob, this is message for answering machine"
            }
        }
    };

    IList<Call> calls = client.CallsApi.Send(request);
}

}

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST -d ' [ { "phoneNumber": "12135551100", "liveMessage": "Hello, Alice, this is message for live answer", "machineMessage": "Hello, Alice, this is message for answering machine" }, { "phoneNumber": "12135551101", "liveMessage": "Hello, Bob, this is message for live answer", "machineMessage": "Hello, Bob, this is message for answering machine" } ]' "https://api.callfire.com/v2/calls?campaignId=4050600003&defaultVoice=MALE1&fields=items(id,state,toNumber)"

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 } ] }

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.callstexts.model.CallRecipient; import com.callfire.api.client.api.callstexts.model.request.SendCallsRequest; import com.callfire.api.client.api.campaigns.model.Voice;

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

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

    CallRecipient r1 = new CallRecipient();
    r1.setPhoneNumber("'12135551100'");
    r1.setLiveMessage("Hello, Alice, this is message for live answer");
    r1.setMachineMessage("Hello, Alice, this is message for answering machine");

    CallRecipient r2 = new CallRecipient();
    r2.setPhoneNumber("''12135551101''");
    r2.setLiveMessage("Hello, Bob, this is message for live answer");
    r2.setMachineMessage("Hello, Bob, this is message for answering machine");

    List<CallRecipient> recipients = Arrays.asList(r1, r2);

    SendCallsRequest request = new SendCallsRequest().create()
        .defaultVoice(Voice.MALE1)
        .campaignId(4050600003L)
        .fields("items(id,state,toNumber)")
        .recipients(recipients)
        .build();

    List<Call> calls = client.callsApi().send(request);
}

}

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.calls.sendCalls({ // default voice for recipients w/o CallRecipient.voice field defaultVoice: 'MALE1', // specify a campaignId to send calls through a previously created campaign // campaignId: 4050600003 // return particular fields in response fields: 'items(id,state,toNumber)', body: [ { phoneNumber: '12135551100', liveMessage: 'Hello, Alice, this is message for live answer', machineMessage: 'Hello, Alice, this is message for answering machine' }, { phoneNumber: '12135551101', liveMessage: 'Hello, Bob, this is message for live answer', machineMessage: 'Hello, Bob, this is message for answering machine' } ] }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->sendCalls();
    $request->getOperationConfig()->setQueryParameters(array("campaignId" => 4050600003,
                                                             "fields" => "items(id,state,toNumber)",
                                                             "defaultVoice" => "MALE1"));
    $body = '[
                {
                    "phoneNumber": "12135551100",
                    "liveMessage": "Hello, Alice, this is message for live answer",
                    "machineMessage": "Hello, Alice, this is message for answering machine"
                },
                {
                    "phoneNumber": "12135551101",
                    "liveMessage": "Hello, Bob, this is message for live answer",
                    "machineMessage": "Hello, Bob, this is message for answering machine"
                }
             ]';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.calls.sendCalls(

# default voice for recipients w/o CallRecipient.voice field
defaultVoice='MALE1',
# specify a campaignId to send calls through a previously created campaign
# campaignId= 4050600003
# return particular fields in response
fields='items(id,state,toNumber)',
body=[
    {
        'phoneNumber': '12135551100',
        'liveMessage': 'Hello, Alice, this is message for live answer',
        'machineMessage': 'Hello, Alice, this is message for answering machine'
    },
    {
        'phoneNumber': '12135551101',
        'liveMessage': 'Hello, Bob, this is message for live answer',
        'machineMessage': 'Hello, Bob, this is message for answering machine'
    }
]

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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
    {
        Id = new List<long> { 11646003, 12646003, 13776003 },
        CampaignId = 449060003,
        BatchId = 447060003,
        FromNumber = "12135551126",
        ToNumber  = "12136666123",
        Label = "my label",
        States = new List<StateType> { StateType.FINISHED, StateType.READY, StateType.INVALID },
        Results = new List<Call.CallResult> { Call.CallResult.LA },
        Inbound = true,
        IntervalBegin = new DateTime(2016, 9, 13, 15, 50, 17),
        IntervalEnd = new DateTime(2016, 9, 13, 15, 50, 17),
        Offset = 0,
        Limit = 10,
        Fields = "items(id,fromNumber,toNumber,modified,finalCallResult)"
    };
    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?id=11646003&id=12646003&id=13776003&campaignId=449060003&batchId=447060003&fromNumber=12135551126&toNumber=12136666123&label=my label&states=READY,FINISHED,INVALID&results=LA&inboubd=true&intervalBegin=1473781817000&intervalEnd=1473781817000&offset=0&limit=10&fields=items(id,fromNumber,toNumber,modified,finalCallResult)"

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 }

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.callstexts.model.request.FindCallsRequest; import com.callfire.api.client.api.common.model.Page; import static com.callfire.api.client.api.callstexts.model.Action.State; import static com.callfire.api.client.api.callstexts.model.Call.CallResult;

import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Arrays;

class ApiClientSample { public static void main(String[] args) throws ParseException { 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(11646003L, 12646003L, 13776003L)) .campaignId(449060003L) .batchId(447060003L) .fromNumber("12135551126") .toNumber("12136666123") .label("my label") .states(Arrays.asList(State.READY, State.FINISHED, State.INVALID)) .results(Arrays.asList(CallResult.LA)) .inbound(false) .intervalBegin(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("2016-09-13 15:50:17")) .intervalEnd(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("2016-09-13 15:50:17")) .offset(0L) .limit(10L) .fields("items(id,fromNumber,toNumber,modified,finalCallResult)") .build(); Page calls = client.callsApi().find(request); // check Call.records.questionResponses list for stored data } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.calls.findCalls({ // filter by call ids id: [ 11646003, 12646003, 13776003 ], // specify id of a campaign, queries for calls inside a particular campaign. // do not set to list calls of all campaigns or 0 for a default campaign campaignId: 449060003, // queries for calls which are used in the particular contact batch batchId: 447060003, // filter by fromNumber fromNumber: '12135551126', // filter by toNumber toNumber: '12136666123', // filter by label label: 'my label', // filter by call state states: 'READY,FINISHED,INVALID', // filter by call result results: 'SENT', // filter only inbound actions inbound: false, // filter by time interval intervalBegin: 1473781817000, // filter by time interval intervalEnd: 1473781817000, // search offset offset: 0, // return 10 items per request limit: 10, // return only specific fields fields: 'items(id,fromNumber,toNumber,modified,finalCallResult)' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->findCalls();
    $request->getOperationConfig()->setQueryParameters(array("id" => 11646003,
                                                             "id" => 12646003,
                                                             "id" => 13776003,
                                                             "campaignId" => 449060003,
                                                             "batchId" => 447060003,
                                                             "fromNumber" => "12135551126",
                                                             "toNumber" => "12136666123",
                                                             "label" => "my label",
                                                             "states" => "READY,FINISHED,INVALID",
                                                             "results" => "LA",
                                                             "inbound" => true,
                                                             "intervalBegin" => 1473781817000,
                                                             "intervalEnd" => 1473781817000,
                                                             "offset" => 0,
                                                             "limit" => 10,
                                                             "fields" => "items(id,fromNumber,toNumber,modified,finalCallResult)"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.calls.findCalls(

# filter by call ids
id=[
    11646003,
    12646003,
    13776003
],
# specify  id of a campaign, queries for calls inside a particular campaign.
# do not set to list calls of all campaigns or 0 for a default campaign
campaignId=449060003,
# queries for calls which are used in the particular contact batch
batchId=447060003,
# filter by fromNumber
fromNumber='12135551126',
# filter by toNumber
toNumber='12136666123',
# filter by label
label='my label',
# filter by call state
states='READY,FINISHED,INVALID',
# filter by call result
results='LA',
# filter only inbound actions
inbound=False,
# filter by time interval
intervalBegin=1473781817000,
# filter by time interval
intervalEnd=1473781817000,
# search offset
offset=0,
# return 10 items per request
limit=10,
# return only specific fields
fields='items(id,fromNumber,toNumber,modified,finalCallResult)'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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)

  • strictValidation boolean

    Turns on strict validation for recipients. System will reply with BAD_REQUEST(400) if strictValidation = true and one of numbers didn't pass validation

  • 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

              
                

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 = new CallBroadcast { Name = "Example API Call Broadcast", // set validated Caller ID number. FromNumber = "12135551189", // 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 a live answer text to speech recording", MachineSoundText = "This is an answering machine text to speech recording" }, // add new recipients Recipients = new List { new Recipient { PhoneNumber = "2134441133" }, new Recipient { PhoneNumber = "2135551144" } }, ResumeNextDay = true };

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

}

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":"2134441133" }, { "phoneNumber":"2135551144" } ], "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 }

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.Recipient; import com.callfire.api.client.api.common.model.ResourceId;

import java.time.DayOfWeek; 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 ApiClientSample {

    public static void main(String[] args) {

     CallfireClient client = new CallfireClient("api_login", "api_password");
     CallBroadcast broadcast = new CallBroadcast();
     broadcast.setName("Example API Call Broadcast");
     // 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.
     CallBroadcastSounds sounds = new CallBroadcastSounds();
     sounds.setLiveSoundText("Hello! This is a live answer text to speech recording");
     sounds.setMachineSoundText("This is an answering machine text to speech recording");
     broadcast.setSounds(sounds);
    
     // add new recipients
     Recipient recipient1 = new Recipient();
     recipient1.setPhoneNumber("2134441133");
    
     Recipient recipient2 = new Recipient();
     recipient2.setPhoneNumber("2135551144");
    
     broadcast.setRecipients(Arrays.asList(recipient1, recipient2));
    
     broadcast.setResumeNextDay(true);
    
     // create broadcast with 'start' argument = true to start campaign immediately
     ResourceId id = client.callBroadcastsApi().create(broadcast, false);
    
     System.out.println(id);

    } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.calls.createCallBroadcast({ // set start parameter to run broadcast immediately // start: true, body: { name: 'Example API Call Broadcast', fromNumber: '12135551189', recipients: [ {phoneNumber: '2134441133'}, {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 } }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->createCallBroadcast();
    $body = '{
                "name":"Example API Call Broadcast",
                "fromNumber":"12135551189",
                "recipients":
                [
                    {
                        "phoneNumber":"2134441133"
                    },
                    {
                        "phoneNumber":"2135551144"
                    }
                ],
                "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"
             }';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.calls.createCallBroadcast(

# set start parameter to run broadcast immediately
# start: true,
body={
    'name': 'Example API Call Broadcast',
    'fromNumber': '12135551189',
    'recipients': [
        {'phoneNumber': '2134441133'},
        {'phoneNumber': '2135551144'}
    ],
    '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
}

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

  • scheduled boolean

    Specify whether the campaigns should be scheduled or not

  • 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

              
                

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 = "broadcast name",
        Label = "my label",
        Running = true,
        Offset = 0,
        Limit = 10,
        Fields = "items(id,name,status,sounds)"
    };
    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=broadcast name&label=my label&running=true&offset=0&limit=10&fields=items(id,name,status,sounds)&scheduled=false&intervalBegin=1473781817000&intervalEnd=1473781817000"

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 }

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("broadcast name") .label("my label") .running(true) .offset(0L) .limit(2L) .fields("items(id,name,status,sounds)") .build(); Page broadcasts = client.callBroadcastsApi().find(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.calls.findCallBroadcasts({ // filter by name name: 'broadcast name', // filter by label label: 'my label', // filter only broadcasts in RUNNING state running: true, // search offset offset: 0, // return 10 items per request limit: 10, // return only specific fields fields: 'items(id,name,status,sounds)' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->findCallBroadcasts();
    $queryParameters = array('name' => 'broadcast name',
                             'label' => 'my label',
                             'running' => true,
                             'offset' => 10,
                             'limit' => 10,
                             'fields' => "items(id,name,status,sounds)");
    $request->getOperationConfig()->setQueryParameters($queryParameters);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.calls.findCallBroadcasts(

# filter by name
name='broadcast name',
# filter by label
label='my label',
# filter only broadcasts in RUNNING state
running=True,
# search offset
offset=0,
# return 10 items per request
limit=10,
# return only specific fields
fields='items(id,name,status,sounds)'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

using CallfireApiClient;

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

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/calls/broadcasts/379506003?fields=name,status,labels"

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" }

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(379506003L, "name,status,labels"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.calls.getCallBroadcast({ id: 379506003, // return only specific fields fields: 'name,status,labels' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getCallBroadcast();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003));
    $request->getOperationConfig()->setQueryParameters(array("fields" => "name,status,labels"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.calls.getCallBroadcast( id=379506003,

# return only specific fields
fields='name,status,labels'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

  • strictValidation boolean

    Turns on strict validation for recipients. System will reply with BAD_REQUEST(400) if strictValidation = true and one of numbers didn't pass validation

  • 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

              
                

using System.Collections.Generic; 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 broadcast = new CallBroadcast() { Id = 11646003, Name = "Call Broadcast with Schedules", AnsweringMachineConfig = AnsweringMachineConfig.LIVE_IMMEDIATE, Sounds = new CallBroadcastSounds() { LiveSoundText = "Hello! This is an updated Call Broadcast config tts" }, Schedules = new List() { 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/11646003"

Example Response

                    
                      

200 OK - No Response

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.Schedule; import com.callfire.api.client.api.common.model.LocalDate; import com.callfire.api.client.api.common.model.LocalTime;

import java.time.DayOfWeek; 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 = new CallBroadcast();

    // 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.getSchedules().add(schedule);

    broadcast.setId(11646003L);
    broadcast.setName("Call Broadcast with Schedules");
    broadcast.setAnsweringMachineConfig(AnsweringMachineConfig.LIVE_IMMEDIATE);
    CallBroadcastSounds sounds = new CallBroadcastSounds();
    sounds.setLiveSoundText("Hello! This is an updated Call Broadcast config tts");
    broadcast.setSounds(sounds);

    // update campaign
    client.callBroadcastsApi().update(broadcast);
}

}

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.calls.updateCallBroadcast({ id: 11646003, body: { 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 } }] } }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->updateCallBroadcast();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $body = '{
                "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
                        }
                    }
                ]
            }';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.calls.updateCallBroadcast( id=11646003, body={ '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 } }] } ).result()

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

              
                

using CallfireApiClient;

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

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

200 OK - No Response

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(11646003L); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.calls.archiveVoiceBroadcast({id: 11646003}) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->archiveVoiceBroadcast();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.calls.archiveVoiceBroadcast(id=11646003).result()

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

  • strictValidation boolean

    Turns on strict validation for recipients. System will reply with BAD_REQUEST(400) if strictValidation = true and one of numbers didn't pass validation

  • 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

              
                

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 request1 = new AddBatchRequest { CampaignId = 11646003, Name = "contact batch for call broadcast", Recipients = new List { new CallRecipient {PhoneNumber = "12135551122"}, new CallRecipient {PhoneNumber = "12135553434"}, new CallRecipient { PhoneNumber = "12135558090", Attributes = new Dictionary { {"custom_external_id", "30005044"}, {"custom_property_1", "value1"} } } }, //or you can add contacts from particular contact list //ContactListId = 70055003 ScrubDuplicates = true }; var resourceId = client.TextBroadcastsApi.AddBatch(request1); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST -d ' { "name":"contact batch for call broadcast", "recipients": [ { "phoneNumber":"12135551122" }, { "phoneNumber":"12135553434" }, { "phoneNumber":"12135558090", "attributes": { "custom_external_id": 30005044, "custom_property_1": "value1" } } ],

    # or you can add contacts from particular contact list
    # contactListId: 70055003,
    "scrubDuplicates": true
}' "https://api.callfire.com/v2/calls/broadcasts/11646003/batches"

Example Response

                    
                      

{ "id": 13 }

Sample Code

              
                
              
          

Sample Code

              
                

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

import java.util.Arrays; import java.util.HashMap; import java.util.Map;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("api_login", "api_password"); CallRecipient recipient1 = new CallRecipient(); recipient1.setPhoneNumber("12135551122"); CallRecipient recipient2 = new CallRecipient(); recipient2.setPhoneNumber("12135553434"); CallRecipient recipient3 = new CallRecipient(); recipient3.setPhoneNumber("12135558090"); Map attrs = new HashMap<>(); attrs.put("custom_external_id", "30005044"); attrs.put("custom_property_1", "value1"); recipient3.setAttributes(attrs);

    AddBatchRequest request = AddBatchRequest.create()
        .campaignId(11646003L)
        .name("contact batch for call broadcast")
        .scrubDuplicates(true)
        .recipients(Arrays.asList(recipient1, recipient2, recipient3))
        //or you can add contacts from particular contact list
        //.contactListId(70055003L)
        .build();
    ResourceId resourceId = callfireClient.callBroadcastsApi().addBatch(request);
}

}

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.calls.addCallBroadcastBatch({ id: 11646003, body: { name: 'contact batch for call broadcast', recipients: [ {phoneNumber: '12135551122'}, {phoneNumber: '12135553434'}, { phoneNumber: '12135558090', attributes: { custom_external_id: 30005044, custom_property_1: 'value1' } }, ], // or you can add contacts from particular contact list // contactListId: 70055003, scrubDuplicates: true } }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->addCallBroadcastBatch();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $body = '{
                "name":"contact batch for call broadcast",
                "recipients":
                [
                    {
                        "phoneNumber":"12135551122"
                    },
                    {
                        "phoneNumber":"12135553434"
                    },
                    {
                        "phoneNumber":"12135558090",
                        "attributes":
                        {
                            "custom_external_id": 30005044,
                            "custom_property_1": "value1"
                        }
                    }
                ],
                # or you can add contacts from particular contact list
                # contactListId: 70055003,
                "scrubDuplicates": true
             }';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.calls.addCallBroadcastBatch( id=11646003, body={ 'name': 'contact batch for call broadcast', 'recipients': [ {'phoneNumber': '12135551122'}, {'phoneNumber': '12135553434'}, { 'phoneNumber': '12135558090', 'attributes': { 'custom_external_id': 30005044, 'custom_property_1': 'value1' } } ],

    # or you can add contacts from particular contact list
    # contactListId: 70055003,
    'scrubDuplicates': True
}

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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 = 11646003, Offset = 0, Limit = 10, Fields = "items(name,status,size,remaining)" }; 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/11646003/batches?offset=0&limit=10&fields=items(name,status,size,remaining)"

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 }

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(11646003L) .offset(0L) .limit(10L) .fields("items(name,status,size,remaining)") .build(); Page batches = client.callBroadcastsApi().getBatches(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.calls.getCallBroadcastBatches({ id: 11646003, // search offset offset: 0, // return 10 items per request limit: 10, // return only specific fields fields: 'items(name,status,size,remaining)' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getCallBroadcastBatches();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $request->getOperationConfig()->setQueryParameters(array("offset" => 0,
                                                             "limit" => 10,
                                                             "fields" => "items(name,status,size,remaining)"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.calls.getCallBroadcastBatches( id=11646003,

# search offset
offset=0,
# return 10 items per request
limit=10,
# return only specific fields
fields='items(name,status,size,remaining)'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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 = 11646003, BatchId = 5500030002, Offset = 0, Limit = 10, Fields = "items(fromNumber,toNumber,state,modified)" }; var calls = client.CallBroadcastsApi.GetCalls(request); } }

Example Request

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 }

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(11646003L) .batchId(5500030002L) .offset(0L) .limit(10L) .fields("items(fromNumber,toNumber,state,modified)") .build(); Page calls = client.callBroadcastsApi().findCalls(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.calls.getCallBroadcastCalls({ id: 11646003, // get calls assigned to particular contact batch batchId: 5500030002, // search offset offset: 0, // return 10 items per request limit: 10, // return only specific fields fields: 'items(fromNumber,toNumber,state,modified)' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getCallBroadcastCalls();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $request->getOperationConfig()->setQueryParameters(array("batchId" => 5500030002,
                                                             "offset" => 0,
                                                             "limit" => 10,
                                                             "fields" => "items(fromNumber,toNumber,state,modified)"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.calls.getCallBroadcastCalls( id=11646003,

# get calls assigned to particular contact batch
batchId=5500030002,
# search offset
offset=0,
# return 10 items per request
limit=10,
# return only specific fields
fields='items(fromNumber,toNumber,state,modified)'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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.

  • strictValidation boolean

    Turns on strict validation for recipients. System will reply with BAD_REQUEST(400) if strictValidation = true and one of numbers didn't pass validation

  • 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

  • fromNumber string

    ~

  • phoneNumber string

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

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(11646003, new List { new Recipient {PhoneNumber = "12135551122"}, new Recipient {ContactId = 122460000043}, new Recipient {PhoneNumber = "12135558090", Attributes = new Dictionary { {"custom_external_id", "30005044"}, {"custom_property_1", "value1"} } } }); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST -d ' [ { "phoneNumber":"12135551122" }, { "contactId":122460000043 }, { "phoneNumber":"12135558090", "attributes": { "custom_external_id": 30005044, "custom_property_1": "value1" } } ]' "https://api.callfire.com/v2/calls/broadcasts/11646003/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 } ] }

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.HashMap; import java.util.List; import java.util.Map;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("api_login", "api_password"); Recipient recipient1 = new Recipient(); recipient1.setPhoneNumber("12135551122"); Recipient recipient2 = new Recipient(); recipient2.setContactId(122460000043L); Recipient recipient3 = new Recipient(); recipient3.setPhoneNumber("12135558090"); Map attrs = new HashMap<>(); attrs.put("custom_external_id", "30005044"); attrs.put("custom_property_1", "value1"); recipient3.setAttributes(attrs); List recipients = Arrays.asList(recipient1, recipient2, recipient3); List calls = callfireClient.callBroadcastsApi().addRecipients(11646003L, recipients); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.calls.addCallBroadcastRecipients({ id: 11646003, body: [ {phoneNumber: '12135551122'}, // use an existing contact in CallFire account {contactId: 122460000043}, { phoneNumber: '12135558090', attributes: { custom_external_id: 30005044, custom_property_1: 'value1' } }, ] }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->addCallBroadcastRecipients();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $body = '[
                {
                    "phoneNumber":"12135551122"
                },
                {
                    "contactId":122460000043
                },
                {
                    "phoneNumber":"12135558090",
                    "attributes":
                    {
                        "custom_external_id": 30005044,
                        "custom_property_1": "value1"
                    }
                }
             ]';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.calls.addCallBroadcastRecipients( id=11646003, body=[ {'phoneNumber': '12135551122'},

    # use an existing contact in CallFire account
    {'contactId': 122460000043},
    {
        'phoneNumber': '12135558090',
        'attributes': {
            'custom_external_id': 30005044,
            'custom_property_1': 'value1'
        }
    }
]

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

using CallfireApiClient;

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

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

200 OK - No Response

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(11646003L); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.calls.startVoiceBroadcast({id: 11646003}) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->startVoiceBroadcast();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.calls.startVoiceBroadcast(id=11646003).result()

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

              
                

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 = "totalOutboundCount,billedAmount,callsAttempted"; var begin = new DateTime(2016, 9, 13, 15, 50, 17); var end = new DateTime(2016, 9, 13, 15, 50, 17); var stats = client.CallBroadcastsApi.GetStats(11646003, fields, begin, end); } }

Example Request

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 }

Sample Code

              
                
              
          

Sample Code

              
                

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

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

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); Date end = new GregorianCalendar(2016, Calendar.SEPTEMBER, 15, 50, 17, 0).getTime(); Date begin = new GregorianCalendar(2016, Calendar.SEPTEMBER, 15, 50, 17, 0).getTime(); // limit returned fields if needed String fields = "totalOutboundCount,billedAmount,callsAttempted"; CallBroadcastStats stats = client.callBroadcastsApi().getStats(11646003L, fields, begin, end); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.calls.getCallBroadcastStats({ id: 11646003, // filter by time interval begin: 1473781817000, // filter by time interval end: 1473781817000, // return only specific fields fields: 'totalOutboundCount,billedAmount,callsAttempted' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getCallBroadcastStats();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $request->getOperationConfig()->setQueryParameters(array("begin" => 1473781817000,
                                                             "end" => 1473781817000,
                                                             "fields" => "totalOutboundCount,billedAmount,callsAttempted"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.calls.getCallBroadcastStats( id=11646003,

# filter by time interval
begin=1473781817000,
# filter by time interval
end=1473781817000,
# return only specific fields
fields='totalOutboundCount,billedAmount,callsAttempted'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

using CallfireApiClient;

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

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

200 OK - No Response

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(11646003L); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.calls.stopVoiceBroadcast({id: 11646003}) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->stopVoiceBroadcast();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.calls.stopVoiceBroadcast(id=11646003).result()

Disable/enable undialed recipients in broadcast post

This operation lets the user to disable/enable undialed recipients in created broadcast

path

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

parameters

  • id integer required

    An id of a voice broadcast

  • enable boolean

    Flag which indicate what to do with calls (true will enable call in DISABLED status and vice versa)

  • 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

  • fromNumber string

    ~

  • phoneNumber string

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

Sample Code

              
                
              
          

Example Request

                  
                    
                  
              

Example Response

                    
                      
                    
                

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

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

              
                

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(379506003, "callId,campaignId,lengthInBytes,mp3Url"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/calls/recordings/379506003?fields=callId,campaignId,lengthInBytes,mp3Url"

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" }

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(379506003L, "callId,campaignId,lengthInBytes,mp3Url"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.calls.getCallRecording({ id: 379506003, // return only specific fields fields: 'callId,campaignId,lengthInBytes,mp3Url' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getCallRecording();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003));
    $request->getOperationConfig()->setQueryParameters(array("fields" => "callId,campaignId,lengthInBytes,mp3Url"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.calls.getCallRecording( id=379506003,

# return only specific fields
fields='callId,campaignId,lengthInBytes,mp3Url'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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(379506003); } }

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

mp3 binary file response

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(379506003L); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.calls.getCallRecordingMp3({id: 379506003}) .then((response) => { // returns binary response console.log(response.data); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getCallRecordingMp3();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003));
    $result = $client->request($request);
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.calls.getCallRecordingMp3(id=379506003).result()

see sample JSON response for this API

on 'curl' samples tab

print(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

              
                

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

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); Call call = client.CallsApi.Get(379506003, "fromNumber,toNumber,modified,finalCallResult"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/calls/379506003?fields=fromNumber,toNumber,modified,finalCallResult"

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 }

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(379506003L, "fromNumber,toNumber,modified,finalCallResult"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.calls.getCall({ id: 379506003, // return only specific fields fields: 'fromNumber,toNumber,modified,finalCallResult' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getCall();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003));
    $request->getOperationConfig()->setQueryParameters(array("fields" => "fromNumber,toNumber,modified,finalCallResult"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.calls.getCall( id=379506003,

# return only specific fields
fields='fromNumber,toNumber,modified,finalCallResult'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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(379506003, "items(callId,campaignId,lengthInBytes,mp3Url)"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/calls/379506003/recordings?fields=items(callId,campaignId,lengthInBytes,mp3Url)"

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" } ] }

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(379506003L, "items(callId,campaignId,lengthInBytes,mp3Url)"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.calls.getCallRecordings({ id: 379506003, // return only specific fields fields: 'items(callId,campaignId,lengthInBytes,mp3Url)' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getCallRecordings();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003));
    $request->getOperationConfig()->setQueryParameters(array("fields" => "items(callId,campaignId,lengthInBytes,mp3Url)"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.calls.getCallRecordings( id=379506003,

# return only specific fields
fields='items(callId,campaignId,lengthInBytes,mp3Url)'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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(379506003, "call-recording1", "callId,campaignId,lengthInBytes,mp3Url"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/calls/379506003/recordings/call-recording1?fields=callId,campaignId,lengthInBytes,mp3Url"

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" }

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(379506003L, "call-recording1", "callId,campaignId,lengthInBytes,mp3Url"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.calls.getCallRecordingByName({ id: 379506003, name: 'call-recording1', // return only specific fields fields: 'callId,campaignId,lengthInBytes,mp3Url' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getCallRecordingByName();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003,
                                                            "name" => "call-recording1"));
    $request->getOperationConfig()->setQueryParameters(array("fields" => "callId,campaignId,lengthInBytes,mp3Url"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.calls.getCallRecordingByName( id=379506003, name='call-recording1',

# return only specific fields
fields='callId,campaignId,lengthInBytes,mp3Url'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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(379506003, "call-recording1"); } }

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

mp3 binary file response

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(379506003L, "call-recording1"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.calls.getCallRecordingMp3ByName({ id: 379506003, name: 'call-recording1' }) .then((response) => { // returns binary response console.log(response.data); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getCallRecordingMp3ByName();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003,
                                                            "name" => "call-recording1"));
    $result = $client->request($request);
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.calls.getCallRecordingMp3ByName( id=379506003, name='call-recording1' ).result()

see sample JSON response for this API

on 'curl' samples tab

print(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

              
                

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(379506003, "name,status,size"); } }

Example Request

Example Response

                    
                      

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

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(379506003L, "name,lengthInSeconds"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.campaigns.getCampaignBatch({ id: 379506003, // return only specific fields fields: 'name,status,size' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getCampaignBatch();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003));
    $request->getOperationConfig()->setQueryParameters(array("fields" => "name,status,size"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.campaigns.getCampaignBatch( id=379506003,

# return only specific fields
fields='name,status,size'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

using CallfireApiClient;

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

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

200 OK - No Response

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(379506003L); batch.setEnabled(true); client.batchesApi().update(batch); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.campaigns.updateCampaignBatch({ id: 379506003, body: { enabled: true } }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->updateCampaignBatch();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003));
    $body = '{
                "enabled": true
             }';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.campaigns.updateCampaignBatch( id=379506003, body={ 'enabled': True } ).result()

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

    value to filter file names again; this value is used to check if the filename contains the filter value.

  • 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

              
                

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 { Filter = "name", IncludeArchived = true, IncludePending = true, IncludeScrubbed = true, Offset = 0, Limit = 10, Fields = "items(id,name,callback)" }; Page campaignSounds = client.CampaignSoundsApi.Find(request); } }

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 }

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() .filter("name") .includeArchived(true) .includePending(true) .includeScrubbed(true) .offset(0L) .limit(10L) .fields("items(id,name,callback)") .build(); Page campaignSounds = callfireClient.campaignSoundsApi().find(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.campaigns.findCampaignSounds({ // filter by sound name filter: 'name', // includes ARCHIVED sounds includeArchived: true, // includes UPLOAD/RECORDING includePending: true, // includes SCRUBBED sounds includeScrubbed: true, // search offset offset: 0, // return 10 items per request limit: 10, // return only specific fields fields: 'items(id,name,callback)' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->findCampaignSounds();
    $request->getOperationConfig()->setQueryParameters(array("filter" => "name",
                                                             "includeArchived" => true,
                                                             "includePending" => true,
                                                             "includeScrubbed" => true,
                                                             "offset" => 0,
                                                             "limit" => 10,
                                                             "fields" => "items(id,name,callback)"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.campaigns.findCampaignSounds(

# filter by sound name
filter='name',
# includes ARCHIVED sounds
includeArchived=True,
# includes UPLOAD/RECORDING
includePending=True,
# includes SCRUBBED sounds
includeScrubbed=True,
# search offset
offset=0,
# return 10 items per request
limit=10,
# return only specific fields
fields='items(id,name,callback)'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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 = "Sound 1", ToNumber = "12135551122" }; 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 }

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("Sound 1"); callCreateSound.setToNumber("12135551122"); ResourceId resourceId = callfireClient.campaignSoundsApi().recordViaPhone(callCreateSound); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.campaigns.postCallCampaignSound({ body: { name: 'Sound 1', toNumber: '12135551122' } }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->postCallCampaignSound();
    $body = '{
                "name":"Sound 1",
                "toNumber":"12135551122"
             }';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.campaigns.postCallCampaignSound( body={ 'name': 'Sound 1', 'toNumber': '12135551122' } ).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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.

  • file file required

    A sound file encoded in binary form

  • name string

    Optional name of a sound file, if the name is empty than it will be taken from a file

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("sound1.mp3", "campaign sound"); } }

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

{ "id": 63 }

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("sound1.mp3").toURI()); CampaignSound mp3Sound = client.campaignSoundsApi().uploadAndGetSoundDetails(mp3File, "campaign sound"); } }

Sample Code

              
                

'strict'

const fs = require('fs'); const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.campaigns.postFileCampaignSound({ name: 'my-file', // for nodejs environment // file: fs.createReadStream('./myfile.wav') // for browser environment // file: new Blob([/ binary data /], {type: 'audio/wav'}) }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->postFileCampaignSound();
    $request->getOperationConfig()->setFileUpload(__dir__.'\sound1.mp3', 'campaign sound');
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.campaigns.postFileCampaignSound( name='campaign sound', file=open('sound1.mp3', 'rb') ).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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 a TTS sound", Voice = Voice.MALE1 }; 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 }

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.MALE1); tts.setMessage("This is a TTS sound"); ResourceId resourceId = callfireClient.campaignSoundsApi().createFromTts(tts); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.campaigns.postTTSCampaignSound({ body: { voice: 'MALE1', message: 'This is a TTS sound' } }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->postTTSCampaignSound();
    $body = '{
                "voice":"MALE1",
                "message":"This is a TTS sound"
             }';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.campaigns.postTTSCampaignSound( body={ 'voice': 'MALE1', 'message': 'This is a TTS sound' } ).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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(379506003, "name,lengthInSeconds"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/campaigns/sounds/379506003?fields=name,lengthInSeconds"

Example Response

                    
                      

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

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 = 379506003L; // use second argument to limit returned fields CampaignSound campaignSound = client.campaignSoundsApi().get(id, "name,lengthInSeconds"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.campaigns.getCampaignSound({ id: 379506003, // return only specific fields fields: 'name,lengthInSeconds' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getCampaignSound();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003));
    $request->getOperationConfig()->setQueryParameters(array("fields" => "name,lengthInSeconds"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.campaigns.getCampaignSound( id=379506003,

# return only specific fields
fields='name,lengthInSeconds'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

using CallfireApiClient;

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

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

200 OK - No Response

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 = 11646003L; client.campaignSoundsApi().delete(id); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.campaigns.deleteCampaignSound({id: 11646003}) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->deleteCampaignSound();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.campaigns.deleteCampaignSound(id=11646003).result()

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

              
                

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(379506003); } }

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

mp3 binary file response

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(379506003L); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.campaigns.getCampaignSoundDataMp3({id: 379506003}) .then((response) => { // returns binary response console.log(response.data); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getCampaignSoundDataMp3();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003));
    $result = $client->request($request);
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.campaigns.getCampaignSoundDataMp3(id=379506003).result()

see sample JSON response for this API

on 'curl' samples tab

print(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

              
                

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(379506003); } }

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

wav binary file response

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(379506003L); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.campaigns.getCampaignSoundDataWav({id: 379506003}) .then((response) => { // returns binary response console.log(response.data); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getCampaignSoundDataWav();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003));
    $result = $client->request($request);
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.campaigns.getCampaignSoundDataWav(id=379506003).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

Create contacts post

Creates contacts in CallFire system. Only values from the next list can be used as external system parameter in contact creation: NATION_BUILDER, SALES_FORCE_CONTACTS, SALES_FORCE_LEADS, SALES_FORCE_REPORTS, ZOHO, NETSUITE, MAIL_CHIMP. See contacts validation rules

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

  • extraPhone1 string

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

  • extraPhone2 string

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

  • extraPhone3 string

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

  • 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

              
                

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 contact1 = new Contact
    {
        FirstName = "Alice",
        LastName = "Moore",
        HomePhone = "12135551126",
        MobilePhone = "12136666123",
        WorkPhone = "14553327789",
        Zipcode = "40460",
        Properties = new Dictionary<string, string>
        {
            {"custom_ext_system_id", "100200301"}
        }
    };

    var contact2 = new Contact
    {
        FirstName = "Bob",
        LastName = "Smith",
        HomePhone = "12135551127",
        Properties = new Dictionary<string, string>
        {
            {"age", "30"},
            {"custom_position", "Manager"}
        }
    };

    IList<ResourceId> contacts = client.ContactsApi.Create(new List<Contact> { contact1, contact2 });
}

}

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_ext_system_id":100200301 } }, { "firstName":"Bob", "lastName":"Smith", "homePhone":"12135551127", "properties": { "custom_age":30, "custom_position":"Manager" } } ]' "https://api.callfire.com/v2/contacts"

Example Response

                    
                      

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

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 contact1 = new Contact(); contact1.setFirstName("Alice"); contact1.setLastName("Moore"); contact1.setHomePhone("12135551126"); contact1.setMobilePhone("12136666123"); contact1.setWorkPhone("14553327789"); contact1.setZipcode("40460"); contact1.getProperties().put("custom_ext_system_id", "100200301");

    Contact contact2 = new Contact();
    contact2.setFirstName("Bob");
    contact2.setLastName("Smith");
    contact2.setHomePhone("12135551127");
    contact2.getProperties().put("age", "30");
    contact2.getProperties().put("custom_position", "Manager");
    List<Contact> inputContacts = Arrays.asList(contact1, contact2);
    List<ResourceId> resultResourceIds = client.contactsApi().create(inputContacts);
}

}

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.contacts.createContacts({ body: [ { firstName: 'Alice', lastName: 'Moore', homePhone: '12135551126', mobilePhone: '12136666123', workPhone: '14553327789', zipcode: '40460', properties: { custom_ext_system_id: 100200301 } }, { firstName: 'Bob', lastName: 'Smith', homePhone: '12135551127', properties: { custom_age: 30, custom_position: 'Manager' } } ] }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->createContacts();
    $body = '[
                {
                    "firstName":"Alice",
                    "lastName":"Moore",
                    "homePhone":"12135551124",
                    "mobilePhone":"12136666123",
                    "workPhone":"14553327789",
                    "zipcode":"40460",
                    "properties":
                    {
                        "custom_ext_system_id":100200301
                    }
                },
                {
                    "firstName":"Bob",
                    "lastName":"Smith",
                    "homePhone":"12135551127",
                    "properties":
                    {
                        "custom_age":30,
                        "custom_position":"Manager"
                    }
                }
             ]';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.contacts.createContacts( body=[ { 'firstName': 'Alice', 'lastName': 'Moore', 'homePhone': '12135551126', 'mobilePhone': '12136666123', 'workPhone': '14553327789', 'zipcode': '40460', 'properties': { 'custom_ext_system_id': 100200301 } }, { 'firstName': 'Bob', 'lastName': 'Smith', 'homePhone': '12135551127', 'properties': { 'custom_age': 30, 'custom_position': 'Manager' } } ] ).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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
    {
        Id = new List<long> { 11646003, 12646003, 13776003 },
        Number = new List<string> { "12135551126", "12136666123" },
        ContactListId = 14400809003,
        PropertyName = "14400809003",
        PropertyValue = "14400809003",
        Offset = 0,
        Limit = 10,
        Fields = "items(id,name,size)"
    };
    Page<Contact> contacts = client.ContactsApi.Find(request);
}

}

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 }

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() .id(Arrays.asList(11646003L, 12646003L, 13776003L)) .number(Arrays.asList("12135551126", "12136666123")) .contactListId(14400809003L) .propertyName("14400809003") .propertyValue("14400809003") .offset(0L) .limit(10L) .build(); Page contacts = client.contactsApi().find(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.contacts.findContacts({ // find contacts with particular ids id: [11646003, 12646003, 13776003], // find contacts by specified phone numbers number: ['12135551126', '12136666123'], // find contacts by contact list contactListId: 14400809003, // find contacts by custom property name propertyName: 14400809003, // find contacts by custom property value propertyValue: 14400809003, // search offset offset: 0, // return 10 items per request limit: 10, // return only specific fields fields: 'items(id,name,size)' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->findContacts();
    $request->getOperationConfig()->setQueryParameters(array("id" => 11646003,
                                                             "id" => 12646003,
                                                             "id" => 13776003,
                                                             "number" => "12135551126",
                                                             "number" => "12136666123",
                                                             "contactListId" => 14400809003,
                                                             "propertyName" => "14400809003",
                                                             "propertyValue" => "14400809003",
                                                             "offset" => 0,
                                                             "limit" => 10,
                                                             "fields" => "items(id,name,size)"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.contacts.findContacts(

# find contacts with particular ids
id=[11646003, 12646003, 13776003],
# find contacts by specified phone numbers
number=['12135551126', '12136666123'],
# find contacts by contact list
contactListId=14400809003,
# find contacts by custom property name
propertyName=14400809003,
# find contacts by custom property value
propertyValue=14400809003,
# search offset
offset=0,
# return 10 items per request
limit=10,
# return only specific fields
fields='items(id,name,size)'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

Add 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

    If set to true add all given numbers to Do-Not-Call list. Default value: true

  • inboundCall boolean

    ~

  • inboundText boolean

    ~

  • numbers array

    A list of phone numbers in E.164 format (11-digit), example: 12132000384, 14142777322

  • source string

    A list of new contact objects which need to be added. Default value: Api V2

  • text boolean

    If set to true add all given numbers to Do-Not-Text list. Default value: true

Sample Code

              
                

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

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 {"12132000381", "12132000382", "12132000383"}, // optional the name of the source Source = "My DNC 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

Sample Code

              
                
              
          

Sample Code

              
                

import java.util.Arrays;

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("12132000381", "12132000382", "12132000383")) // optional the name of the source .source("My DNC list 1") .build(); client.dncApi().create(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.contacts.addDoNotContacts({ body: { source: 'My DNC list 1', call: true, text: true, numbers: [ '12132000381', '12132000382', '12132000383' ] } }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->addDoNotContacts();
    $body = '{
                "source": "My DNC list 1",
                "call": true,
                "text": true,
                "numbers": ["12132000381", "12132000382", "12132000383"]
             }';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.contacts.addDoNotContacts( body={ 'source': 'My DNC list 1', 'call': True, 'text': True, 'numbers': [ '12132000381', '12132000382', '12132000383' ] } ).result()

see sample JSON response for this API

on 'curl' samples tab

print(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

    A campaign id which was used to send a message to a DNC number

  • source string

    A DNC source name to search for DNCs

  • call boolean

    Show only Do-Not-Call numbers

  • text boolean

    Show only Do-Not-Text numbers

  • inboundCall boolean

    ~

  • inboundText boolean

    ~

  • number array

    ~

Sample Code

              
                

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

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new FindDncNumbersRequest() { Prefix = "1424", Numbers = new List { "12135551126", "12136666123" }, CampaignId = 11646003, Source = "my source", Call = true, Text = true, Offset = 0, Limit = 10, Fields = "items(number,call)" }; 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?prefix=1424&number=12135551126&number=12136666123&campaignId=11646003&source=my source&call=true&text=true&offset=0&limit=10&fields=items(number,call)"

Example Response

                    
                      

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

Sample Code

              
                
              
          

Sample Code

              
                

import java.util.Arrays;

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() .prefix("1424") .numbers(Arrays.asList("12135551126", "12136666123")) .campaignId(11646003L) .source("my source") .call(true) .text(true) .offset(0L) .limit(10L) .fields("items(number,call)") .build(); Page dncContacts = client.dncApi().find(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.contacts.findDoNotContacts({ // filter by Prefix (1-10 digits) of phone numbers prefix: '1424', // find DNCs by specified phone numbers number: ['12135551126', '12136666123'], // filter by campaign campaignId: 11646003, // filter by DNC source source: 'my source', // filter by call feature call: true, // filter by text feature text: true, // search offset offset: 0, // return 10 items per request limit: 10, // return only specific fields fields: 'items(number,call)' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->findDoNotContacts();
    $request->getOperationConfig()->setQueryParameters(array("prefix" => "1424",
                                                             "number" => "12135551126",
                                                             "number" => "12136666123",
                                                             "campaignId" => 11646003,
                                                             "source" => "my source",
                                                             "call" => true,
                                                             "text" => true,
                                                             "offset" => 0,
                                                             "limit" => 10,
                                                             "limit" => "items(number,call)"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.contacts.findDoNotContacts(

# filter by Prefix (1-10 digits) of phone numbers
prefix='1424',
# find DNCs by specified phone numbers
number=['12135551126', '12136666123'],
# filter by campaign
campaignId=11646003,
# filter by DNC source
source='my source',
# filter by call feature
call=True,
# filter by text feature
text=True,
# search offset
offset=0,
# return 10 items per request
limit=10,
# return only specific fields
fields='items(number,call)'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); client.DncApi.DeleteDncsFromSource("My DNC List 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

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 List 1"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.contacts.deleteDoNotContactsBySource({ source: 'My DNC List 1' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->deleteDoNotContactsBySource();
    $request->getOperationConfig()->setPathParameters(array("source" => "My DNC List 1"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.contacts.deleteDoNotContactsBySource(source='My DNC List 1').result()

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

              
                

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

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); FindUniversalDncsRequest request = new FindUniversalDncsRequest() { ToNumber = "12135551126", FromNumber = "12130021127", Fields = "toNumber,inboundCall,outboundCall" }; 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/12135551126?fromNumber=12130021127&fields=toNumber,inboundCall,outboundCall"

Example Response

                    
                      

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

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() .toNumber("12135551126") .fromNumber("12130021127") .fields("toNumber,inboundCall,outboundCall") .build(); List universalDncs = client.dncApi().findUniversalDncs(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.contacts.getUniversalDoNotContacts({ // a required destination phone number in E.164 format (11-digit) toNumber: '12135551126', // an optional destination/source number for DNC, specified in E.164 format (11-digit) fromNumber: '12130021127', // return only specific fields fields: 'toNumber,inboundCall,outboundCall' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getUniversalDoNotContacts();
    $request->getOperationConfig()->setPathParameters(array("toNumber" => "12135551126"));
    $request->getOperationConfig()->setQueryParameters(array("fromNumber" => "12130021127",
                                                             "fields" => "toNumber,inboundCall,outboundCall"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.contacts.getUniversalDoNotContacts(

# a required destination phone number in E.164 format (11-digit)
toNumber='12135551126',
# an optional destination/source number for DNC, specified in E.164 format (11-digit)
fromNumber='12130021127',
# return only specific fields
fields='toNumber,inboundCall,outboundCall'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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("12135551126"); } }

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

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

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("12135551126"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.contacts.getDoNotContact({number: '12135551126'}) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getDoNotContact();
    $request->getOperationConfig()->setPathParameters(array("number" => "12135551188"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.contacts.getDoNotContact(number='12135551126').result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

using CallfireApiClient;

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

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

204 - No Content

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("12135551126,12136666123"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.contacts.deleteDoNotContact({ number: '12135551126,12136666123' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->deleteDoNotContact();
    $request->getOperationConfig()->setPathParameters(array("number" => "12135551126,12136666123"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.contacts.deleteDoNotContact(number='12135551126,12136666123').result()

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

    An Id of a campaign which was used to send a message to DNC number

  • created integer

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

  • inboundCall boolean

    ~

  • inboundText boolean

    ~

  • number string

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

  • source string

    The name of DNC source (can be the name of DNC list that user uploads to CallFire)

  • text boolean

    A number on Do-Not-Text list

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() { Call = true, Text = false, Number = "12132000381" }; 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": false }' "https://api.callfire.com/v2/contacts/dncs/12132000381"

Example Response

                    
                      

200 OK - No Response

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() .call(true) .text(false) .number("'12132000381'") .build(); client.dncApi().update(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.contacts.updateDoNotContact({ number: '12132000381', body: { call: true, text: false } }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->updateDoNotContact();
    $request->getOperationConfig()->setPathParameters(array("number" => "12132000381"));
    $body = '{
                "call": true,
                "text": true
             }';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.contacts.updateDoNotContact( number='12132000381', body={ 'call': True, 'text': False } ).result()

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. You can configure to keep/merge or 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

  • useCustomFields boolean

    A flag to indicate how to define property names for contacts. If true, uses the field and property names exactly as defined. If false will assign custom properties and fields to A, B, C, etc

  • 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

              
                

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 request1 = new CreateContactListRequest<Contact>
    {
        Contacts = new List<Contact>
        {
            new Contact
            {
                FirstName = "Alice",
                LastName = "Moore",
                HomePhone = "12135551126"
            },
            new Contact
            {
                FirstName = "Bob",
                LastName = "Smith",
                HomePhone = "12135551127",
                Properties = new Dictionary<string, string>
                {
                    {"age", "30"}
                }
            }
        },
        Name = "My Contact List"
    };
    ResourceId resourceId1 = client.ContactListsApi.Create(request1);

    var request2 = new CreateContactListRequest<string>
    {
        Contacts = new List<string> {"12132212384", "12136612355", "12133312300"},
        ContactNumbersField = "workPhone",
        Name = "My Contact List"
    };
    ResourceId resourceId2 = client.ContactListsApi.Create(request2);

    var request3 = new CreateContactListRequest<long>
    {
        Contacts = new List<long> {800634185003, 800734186003, 800834187003, 800984185003},
        Name = "My Contact List"
    };
    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":"My Contact List", "contacts": [ { "firstName": "Alice", "lastName": "Moore", "homePhone": "12135551126" }, { "firstName": "Bob", "lastName": "Smith", "homePhone": "12135551127", "properties": { "age": 30 } } ] }' "https://api.callfire.com/v2/contacts/lists"

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

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

Example Response

                    
                      

{ "id": 3 }

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("My Contact List") .contacts(Arrays.asList("12132212384", "12136612355", "12133312300")) .contactNumbersField("workPhone") .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("My Contact List")
        .contacts(Arrays.asList(800634185003L, 800734186003L, 800834187003L, 800984185003L))
        .build();
    ResourceId resourceId2 = client.contactListsApi().create(request2);

    // next code sample uses Contact object in CreateContactListRequest request:
    Contact contact1 = new Contact();
    contact1.setFirstName("Alice");
    contact1.setLastName("Moore");
    contact1.setHomePhone("12135551126");

    Contact contact2 = new Contact();
    contact1.setFirstName("Bob");
    contact1.setLastName("Smith");
    contact1.setHomePhone("12135551127");
    contact1.getProperties().put("age", "30");
    CreateContactListRequest request3 = CreateContactListRequest.<Contact>create()
        .name("My Contact List")
        .contacts(Arrays.asList(contact1, contact2))
        .build();
    ResourceId resourceId3 = client.contactListsApi().create(request3);
}

}

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.contacts.createContactList({ body: { name: 'My Contact List', // choose one of available source of contacts: array of contact objects, // existing contacts (ids) or array of numbers contacts: [ { firstName: 'Alice', lastName: 'Moore', homePhone: '12135551126' }, { firstName: 'Bob', lastName: 'Smith', homePhone: '12135551127', properties: { age: 30 } } ], // add existing contacts to list // contactIds: [ // 800634185003, // 800734186003, // 800834187003, // 800984185003 // ], // add phone numbers to list // contactNumbers: [ // '12132212384', // '12136612355', // '12133312300' // ], // contactNumbersField: 'workPhone' } }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request1 = $client->createContactList();
    $body = '{
                "name":"My Contact List",
                "contacts":
                [
                    {
                        "firstName": "Alice",
                        "lastName": "Moore",
                        "homePhone": "12135551126"
                    },
                    {
                        "firstName": "Bob",
                        "lastName": "Smith",
                        "homePhone": "12135551127",
                        "properties": {
                            "age": 30
                        }
                    }
                ]
             }';
    $request1->getOperationConfig()->setBodyParameter($body);
    $result1 = $client->request($request1);
    $json = json_decode($result1->getBody());

    $request2 = $client->createContactList();
    $body = '{
                "name":"My Contact List",
                "contactIds": [
                    800634185003,
                    800734186003,
                    800834187003,
                    800984185003
                ]
             }';
    $request2->getOperationConfig()->setBodyParameter($body);
    $result2 = $client->request($request2);

    $request3 = $client->createContactList();
    $body = '{
                "name":"My Contact List",
                "contactNumbers": [
                    "12132212384",
                    "12136612355",
                    "12133312300"
                ],
                contactNumbersField: "workPhone"
             }';
    $request3->getOperationConfig()->setBodyParameter($body);
    $result3 = $client->request($request3);
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.contacts.createContactList( body={ 'name': 'My Contact List',

    # choose one of available source of contacts: array of contact objects,
    # existing contacts (ids) or array of numbers
    'contacts': [
        {
            'firstName': 'Alice',
            'lastName': 'Moore',
            'homePhone': '12135551126'
        },
        {
            'firstName': 'Bob',
            'lastName': 'Smith',
            'homePhone': '12135551127',
            'properties': {
                'age': 30
            }
        }
    ],
    # add existing contacts to list
    # contactIds: [
    #   800634185003,
    #   800734186003,
    #   800834187003,
    #   800984185003
    # ],
    # add phone numbers to list
    # contactNumbers: [
    #   '12132212384',
    #   '12136612355',
    #   '12133312300'
    # ],
    # contactNumbersField: 'workPhone'
}

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

  • contactCount integer

    ~

  • orderBy string

    ~

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
    {
        Name = "my list",
        Offset = 0,
        Limit = 10,
        Fields = "items(id,name,size)"
    };
    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?name=my list&offset=0&limit=10&fields=items(id,name,size)"

Example Response

                    
                      

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

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() .name("my list") .offset(0L) .limit(10L) .fields("items(id,name,size)") .build(); Page contactLists = client.contactListsApi().find(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.contacts.findContactLists({ // filter by partial contact list name name: 'my list', // search offset offset: 0, // return 10 items per request limit: 10, // return only specific fields fields: 'items(id,name,size)' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->findContactLists();
    $request->getOperationConfig()->setQueryParameters(array("name" => "my list",
                                                             "offset" => 0,
                                                             "limit" => 10,
                                                             "fields" => "items(id,name,size)"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.contacts.findContactLists(

# filter by partial contact list name
name='my list',
# search offset
offset=0,
# return 10 items per request
limit=10,
# return only specific fields
fields='items(id,name,size)'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

parameters

  • file file required

    CSV file to be uploaded

  • name string

    A name of a contact list

  • useCustomFields boolean

    A flag to indicate how to define property names for contacts. If true, uses the field and property names exactly as defined. If false will assign custom properties and fields to A, B, C, etc

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 = "/contacts.csv";
    ResourceId listId = client.ContactListsApi.CreateFromCsv("My Contact List", Path.GetFullPath(path));
}

}

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -X POST -F "name=My Contact List" -F "file=@contacts.csv" -F "useCustomFields=true" "https://api.callfire.com/v2/contacts/lists/upload"

Example Response

                    
                      

{ "id": 4 }

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.csv"); ResourceId resourceId = client.contactListsApi().createFromCsv("My Contact List", file); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.contacts.createContactListFromFile({ name: 'My Contact List', file: new Blob([''], {type: 'text/plain'}) }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->createContactListFromFile();
    $request->getOperationConfig()->setFileUpload(__dir__.'\contacts.csv', 'My Contact List');
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.contacts.createContactListFromFile( name='My Contact List', file=open('contacts.csv', 'r') ).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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(379506003, "id,name,size,created"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/contacts/lists/379506003?fields=id,name,size,created"

Example Response

                    
                      

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

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(379506003L, "id,name,size,created"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.contacts.getContactList({ id: 379506003, // return only specific fields fields: 'id,name,size,created' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getContactList();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003));
    $request->getOperationConfig()->setQueryParameters(array("fields" => "id,name,size,created"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.contacts.getContactList( id=379506003,

# return only specific fields
fields='id,name,size,created'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

using CallfireApiClient;

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

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

204 - No Content

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(11646003L); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.contacts.deleteContactList({id: 11646003}) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->deleteContactList();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.contacts.deleteContactList(id=11646003).result()

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

              
                

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 = 11646003, Name = "contact list updated" }; client.ContactListsApi.Update(request); } }

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

200 OK - No Response

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(11646003L) .name("contact list updated") .build(); client.contactListsApi().update(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.contacts.updateContactList({ id: 11646003, body: { name: 'contact list updated' } }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->updateContactList();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $body = '{
                "name":"contact list updated"
             }';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.contacts.updateContactList( id=11646003, body={ 'name': 'contact list updated' } ).result()

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

  • useCustomFields boolean

    A flag to indicate how to define property names for contacts. If true, uses the field and property names exactly as defined. If false will assign custom properties and fields to A, B, C, etc

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");

    var request1 = new AddContactListContactsRequest<Contact>
    {
        Contacts = new List<Contact>
        {
            new Contact
            {
                FirstName = "Alice",
                LastName = "Moore",
                HomePhone = "12135551126"
            },
            new Contact
            {
                FirstName = "Bob",
                LastName = "Smith",
                HomePhone = "12135551127",
                Properties = new Dictionary<string, string>
                {
                    {"age", "30"}
                }
            }
        },
        ContactListId = 45006708003
    };
    client.ContactListsApi.AddListItems(request1);

    var request2 = new AddContactListContactsRequest<string>
    {
        Contacts = new List<string> {"12132212384", "12136612355", "12133312300"},
        ContactNumbersField = "workPhone",
        ContactListId = 45006708003
    };
    client.ContactListsApi.AddListItems(request2);

    var request3 = new AddContactListContactsRequest<long>
    {
        Contacts = new List<long> {800634185003, 800734186003, 800834187003, 800984185003},
        ContactListId = 45006708003
    };
    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/45006708003/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/45006708003/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/45006708003/items"

Example Response

                    
                      

200 OK - No Response

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");

    Contact contact1 = new Contact();
    contact1.setFirstName("Alice");
    contact1.setLastName("Moore");
    contact1.setHomePhone("12135551126");

    Contact contact2 = new Contact();
    contact1.setFirstName("Bob");
    contact1.setLastName("Smith");
    contact1.setHomePhone("12135551127");
    contact1.getProperties().put("age", "30");

    AddContactListItemsRequest request1 = AddContactListItemsRequest.<Contact>create()
        .contactListId(45006708003L)
        .contacts(Arrays.asList(contact1, contact2))
        .build();
    client.contactListsApi().addListItems(request1);

    AddContactListItemsRequest request2 = AddContactListItemsRequest.<String>create()
        .contactListId(45006708003L)
        .contactNumbersField("workPhone")
        .contacts(Arrays.asList("12132212384", "12136612355", "12133312300"))
        .build();
    client.contactListsApi().addListItems(request2);

    AddContactListItemsRequest request3 = AddContactListItemsRequest.<Long>create()
        .contactListId(45006708003L)
        .contacts(Arrays.asList(800634185003L, 800734186003L, 800834187003L, 800984185003L))
        .build();
    client.contactListsApi().addListItems(request3);
}

}

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.contacts.addContactListItems({ id: 45006708003, body: { // choose one of source of contacts: array of contact objects / existing contacts (ids) / array of numbers contacts: [ { firstName: 'Alice', lastName: 'Moore', homePhone: '12135551126' }, { firstName: 'Bob', lastName: 'Smith', homePhone: '12135551127', properties: { age: 30 } } ], // add existing contacts to list // contactIds: [ // 800634185003, // 800734186003, // 800834187003, // 800984185003 // ], // add phone numbers to list // contactNumbers: [ // '12132212384', // '12136612355', // '12133312300' // ], // contactNumbersField: 'workPhone' } }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request1 = $client->addContactListItems();
    $request1->getOperationConfig()->setPathParameters(array("id" => 45006708003));
    $body = '{
                "contacts":
                [
                    {
                        "firstName":"Alice",
                        "lastName":"Moore",
                        "homePhone":"12135551126"
                    },
                    {
                        "firstName":"Bob",
                        "lastName":"Smith",
                        "homePhone":"12135551127",
                        "properties":
                        {
                            "age":30
                        }
                    }
                ]
             }';
    $request1->getOperationConfig()->setBodyParameter($body);
    $result1 = $client->request($request1);
    $json = json_decode($result1->getBody());

    $request2 = $client->addContactListItems();
    $request2->getOperationConfig()->setPathParameters(array("id" => 45006708003));
    $body = '{
                "contactIds":
                [
                    800634185003,
                    800734186003,
                    800834187003,
                    800984185003
                ]
             }';
    $request2->getOperationConfig()->setBodyParameter($body);
    $result2 = $client->request($request2);
    $json = json_decode($result2->getBody());

    $request3 = $client->addContactListItems();
    $request3->getOperationConfig()->setPathParameters(array("id" => 45006708003));
    $body = '{
                "contactNumbers":
                [
                    "12132212384",
                    "12136612355",
                    "12133312300"
                ],
                "contactNumbersField":"workPhone"
             }';
    $request3->getOperationConfig()->setBodyParameter($body);
    $result3 = $client->request($request3);
    $json = json_decode($result3->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.contacts.addContactListItems( id=45006708003, body={

    # choose one of source of contacts: array of contact objects / existing contacts (ids) / array of numbers
    'contacts': [
        {
            'firstName': 'Alice',
            'lastName': 'Moore',
            'homePhone': '12135551126'
        },
        {
            'firstName': 'Bob',
            'lastName': 'Smith',
            'homePhone': '12135551127',
            'properties': {
                'age': 30
            }
        }
    ],
    # add existing contacts to list
    # contactIds: [
    #   800634185003,
    #   800734186003,
    #   800834187003,
    #   800984185003
    # ],
    # add phone numbers to list
    # contactNumbers: [
    #   '12132212384',
    #   '12136612355',
    #   '12133312300'
    # ],
    # contactNumbersField: 'workPhone'
}

).result()

see sample JSON response for this API

on 'curl' samples tab

print(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

              
                

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 = 379506003, Offset = 0, Limit = 10, Fields = "items(firstName,lastName,workPhone)" }; 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/379506003/items?offset=0&limit=10&fields=items(firstName,lastName,workPhone)"

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 }

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");

    GetByIdRequest request = GetByIdRequest.create()
        .id(379506003L)
        .offset(0L)
        .limit(10L)
        .fields("items(firstName,lastName,workPhone)")
        .build();
    client.contactListsApi().getListItems(request);
}

}

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.contacts.getContactListItems({ id: 379506003, // search offset offset: 0, // return 10 items per request limit: 10, // return only specific fields fields: 'items(firstName,lastName,workPhone)' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getContactListItems();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003));
    $request->getOperationConfig()->setQueryParameters(array("offset" => 0,
                                                             "limit" => 10,
                                                             "fields" => "items(firstName,lastName,workPhone)"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.contacts.getContactListItems( id=379506003,

# search offset
offset=0,
# return 10 items per request
limit=10,
# return only specific fields
fields='items(firstName,lastName,workPhone)'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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(11646003, new List {22277003, 23377003}); } }

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

200 OK - No Response

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(11646003L, Arrays.asList(22277003L, 23377003L)); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.contacts.removeContactListItems({ // contact list id id: 11646003, // array of contact ids to remove contactId: [22277003, 23377003] }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->removeContactListItems();
    $request->getOperationConfig()->setPathParameters(array("11646003" => 123456));
    $request->getOperationConfig()->setQueryParameters(array("contactId" => 22277003,
                                                             "contactId" => 23377003));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.contacts.removeContactListItems(

# contact list id
id=11646003,
# array of contact ids to remove
contactId=[22277003, 23377003]

).result()

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

              
                

using CallfireApiClient;

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

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

200 OK - No Response

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(11646003L, 22277003L); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.contacts.removeContactListItem({ // contact list id id: 11646003, // contact id to remove contactId: 22277003, }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->removeContactListItem();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003,
                                                            "contactId" => 22277003));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.contacts.removeContactListItem(

# contact list id
id=11646003,
# contact id to remove
contactId=22277003

).result()

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

              
                

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(379506003, "firstName,lastName,workPhone"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/contacts/379506003?fields=firstName,lastName,workPhone"

Example Response

                    
                      

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

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(379506003L, "firstName,lastName,workPhone"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.contacts.getContact({ id: 379506003, // return only specific fields fields: 'firstName,lastName,workPhone' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getContact();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003));
    $request->getOperationConfig()->setQueryParameters(array("fields" => "firstName,lastName,workPhone"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.contacts.getContact( id=379506003,

# return only specific fields
fields='firstName,lastName,workPhone'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

using CallfireApiClient;

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

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

204 - No Content

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(11646003L); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.contacts.deleteContact({id: 11646003}) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->deleteContact();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.contacts.deleteContact(id=11646003).result()

Update a contact put

Updates a single contact instance with id specified. See contact validation rules

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

  • extraPhone1 string

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

  • extraPhone2 string

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

  • extraPhone3 string

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

  • 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

              
                

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 = 11646003, MobilePhone = "12136600123", WorkPhone = "14553320089" }; client.ContactsApi.Update(contact); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X PUT -d ' { "mobilePhone":"12136600123", "workPhone":"14553320089" }' "https://api.callfire.com/v2/contacts/11646003"

Example Response

                    
                      

200 OK - No Response

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(11646003L); contact.setMobilePhone("12136600123"); contact.setWorkPhone("14553320089"); client.contactsApi().update(contact); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.contacts.updateContact({ id: 11646003, body: { mobilePhone: '12136600123', workPhone: '14553320089', } }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->updateContact();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $body = '{
                "mobilePhone":"12136600123",
                "workPhone":"14553320089"
             }';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.contacts.updateContact( id=11646003, body={ 'mobilePhone': '12136600123', 'workPhone': '14553320089', } ).result()

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.

  • 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

              
                

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 = 379506003, Offset = 0, Limit = 10, Fields = "calls/fromNumber,calls/toNumber,texts/message" }; 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/379506003/history?offset=0&limit=10&fields=calls/fromNumber,calls/toNumber,texts/message"

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" } ] } ] }

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"); GetByIdRequest request = GetByIdRequest.create() .id(379506003L) .offset(0L) .limit(10L) .fields("calls/fromNumber,calls/toNumber,texts/message") .build(); ContactHistory history = client.contactsApi().getHistory(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.contacts.getContactHistory({ id: 379506003, // search offset offset: 0, // return 10 items per request limit: 10, // return only specific fields fields: 'calls/fromNumber,calls/toNumber,texts/message' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getContactHistory();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003,
                                                            "offset" => 0,
                                                            "limit" => 10,
                                                            "fields" => "calls/fromNumber,calls/toNumber,texts/message"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.contacts.getContactHistory( id=379506003,

# search offset
offset=0,
# return 10 items per request
limit=10,
# return only specific fields
fields='calls/fromNumber,calls/toNumber,texts/message'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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). Keyword should only consist of uppercase and lowercase letters and numbers. Number of characters must be greater than 2, but less than 65.

path

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

parameters

  • keywords array

    A keyword to search for

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" } ] }

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

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.keywords.findKeywords({ keywords: ['SUN', 'MOON'] }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->findKeywords();
    $request->getOperationConfig()->setQueryParameters(array("keywords" => "SUN",
                                                             "keywords" => "MOON"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.keywords.findKeywords( keywords=['SUN', 'MOON'] ).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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.

  • filter string

    Filter by part of Keyword name or Label name of Keyword

  • labelName string

    An exact label name to search by

  • 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

              
                

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 { Offset = 0, Limit = 10, Fields = "items(keyword,leaseBegin,leaseEnd)" }; 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?offset=0&limit=10&fields=items(keyword,leaseBegin,leaseEnd)"

Example Response

                    
                      

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

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() .offset(0L) .limit(10L) .fields("items(keyword,leaseBegin,leaseEnd)") .build(); Page leases = client.keywordLeasesApi().find(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.keywords.findKeywordLeases({ // search offset offset: 0, // return 10 items per request limit: 10, // return only specific fields fields: 'items(keyword,leaseBegin,leaseEnd)' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->findKeywordLeases();
    $request->getOperationConfig()->setQueryParameters(array("offset" => 0,
                                                             "limit" => 10,
                                                             "fields" => "items(keyword,leaseBegin,leaseEnd)"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.keywords.findKeywordLeases(

# search offset
offset=0,
# return 10 items per request
limit=10,
# return only specific fields
fields='items(keyword,leaseBegin,leaseEnd)'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

Find keyword lease configs get

Searches for all keyword lease configs for the user. Returns a paged list of KeywordConfig

path

  • https://api.callfire.com/v2/keywords/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.

  • filter string

    Filter by part of Keyword name or Label name of Keyword

  • labelName string

    An exact label name to search by

  • 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

              
                
              
          

Example Request

                  
                    
                  
              

Example Response

                    
                      
                    
                

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Find a specific keyword lease config get

Returns a single KeywordConfig instance for a given keyword lease

path

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

parameters

  • keyword string required

    A Keyword to get KeywordConfig by

  • 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

              
                
              
          

Example Request

                  
                    
                  
              

Example Response

                    
                      
                    
                

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Update a keyword lease config put

Updates a keyword lease configuration. Use this API endpoint to enable/disable inbound SMS forwarding, set forward number. Forward number must be in E.164 format)

path

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

parameters

  • keyword string required

    To update a keyword lease config

  • body {...} ref

    KeywordConfig

  • keyword string

    ~

  • textInboundConfig ref

    ~

Sample Code

              
                
              
          

Example Request

                  
                    
                  
              

Example Response

                    
                      
                    
                

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Find a keyword by id get

Get keyword by id

path

  • https://api.callfire.com/v2/keywords/leases/id/{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

              
                
              
          

Example Request

                  
                    
                  
              

Example Response

                    
                      
                    
                

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

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

              
                

using CallfireApiClient;

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

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/keywords/leases/SUN?fields=items(keyword,leaseBegin,leaseEnd)"

Example Response

                    
                      

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

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("SUN", "items(keyword,leaseBegin,leaseEnd)"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.keywords.getKeywordLease({ keyword: 'SUN', // return only specific fields fields: 'items(keyword,leaseBegin,leaseEnd)' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getKeywordLease();
    $request->getOperationConfig()->setPathParameters(array("keyword" => "SUN"));
    $request->getOperationConfig()->setQueryParameters(array("fields" => "items(keyword,leaseBegin,leaseEnd)"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.keywords.getKeywordLease( keyword='SUN',

# return only specific fields
fields='items(keyword,leaseBegin,leaseEnd)'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

Update a lease put

Updates a keyword lease. Turns the autoRenew on/off. Configure double opt in feature. Add/remove contact list from keyword.

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

  • contactListId integer

    Existing contact list ID

  • doubleOptInEnabled boolean

    Enable/disable double opt in feature

  • keyword string

    A text used as a keyword

  • labels array

    ~

  • 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

  • optInConfirmationMessage string

    Opt in confirmation message

  • shortCode string

    A short code assigned to keyword. Example: 67076

  • status string

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

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 = "SUN", 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/SUN"

Example Response

                    
                      

200 OK - No Response

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("SUN"); keywordLease.setAutoRenew(false); client.keywordLeasesApi().update(keywordLease); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.keywords.updateKeywordLease({ keyword: 'SUN', body: { autoRenew: false } }) .then((response) => { console.log(response.data); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->updateKeywordLease();
    $request->getOperationConfig()->setPathParameters(array("keyword" => "SUN"));
    $body = '{
                "autoRenew":"false"
             }';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.keywords.updateKeywordLease( keyword='SUN', body={ 'autoRenew': False } ).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

Check for a specific keyword get

Searches for the specific keyword to purchase on the CallFire platform. Returns 'true' if keyword is available. Keyword should only consist of uppercase and lowercase letters and numbers. Number of characters must be greater than 2, but less than 65.

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

              
                

using CallfireApiClient;

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

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

true

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("SUN"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.keywords.isKeywordAvailable({keyword: 'SUN'}) .then((response) => { console.log(response.data); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->isKeywordAvailable();
    $request->getOperationConfig()->setPathParameters(array("keyword" => "SUN"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.keywords.isKeywordAvailable(keyword='SUN').result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

Find account details get

Searches for the user account details. Details include name, email, and basic account permissions. For authentication use api credentials.

path

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

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 "api_login:api_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" ] }

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

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.me.getAccount() .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("api_login", "api_password");
    $request = $client->getAccount();
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.me.getAccount().result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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. For authentication use account credentials.

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

              
                

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

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("account_login", "account_password"); ApiCredentials credentials = new ApiCredentials {Name = "api-integration"}; credentials = client.MeApi.CreateApiCredentials(credentials); } }

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

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

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-integration"); credentials = callfireClient.meApi().createApiCredentials(credentials); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('account-login', 'account-password');

client.ready(() => { client.me.createApiCredential({body: {name: 'api-integration'}}) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample{

public static function main() {
    $client =\CallFire\Api\DocumentedClient::createClient ("account_login", "account_password");
    $request = $client -> createApiCredential();
    $body = '{
                "name":"api-integration"
             }';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('account-login', 'account-password') response = client.me.createApiCredential( body={ 'name': 'api-integration' } ).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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. For authentication use account credentials.

path

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

parameters

  • name string

    Filter by 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.

  • 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

              
                

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("account_login", "account_password"); var request = new CommonFindRequest { Fields = "name,enabled" }; Page apiCredentials = client.MeApi.FindApiCredentials(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "account_login:account_password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/me/api/credentials?fields=name,enabled"

Example Response

                    
                      

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

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() .fields("name,enabled") .build(); Page credentials = callfireClient.meApi().findApiCredentials(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('account-login', 'account-password');

client.ready(() => { client.me.findApiCredentials({ // return only specific fields fields: 'name,enabled' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("account_login", "account_password");
    $request = $client->findApiCredentials();
    $request->getOperationConfig()->setQueryParameters(array("fields" => "name,enabled"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('account-login', 'account-password') response = client.me.findApiCredentials(

# return only specific fields
fields='name,enabled'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

Find a specific api credential get

Returns an API credential instance for a given api credential id. Only ACCOUNT_HOLDER can invoke this API. For authentication use account credentials.

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

              
                

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

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

Example Request

                  
                    

!/usr/bin/env bash

curl -u "account_login:account_password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/me/api/credentials/379506003?fields=name,enabled"

Example Response

                    
                      

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

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(379506003L, "name,enabled"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('account-login', 'account-password');

client.ready(() => { client.me.getApiCredential({ id: 379506003, // return only specific fields fields: 'name,enabled' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("account_login", "account_password");
    $request = $client->getApiCredential();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003));
    $request->getOperationConfig()->setQueryParameters(array("fields" => "name,enabled"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('account-login', 'account-password') response = client.me.getApiCredential( id=379506003,

# return only specific fields
fields='name,enabled'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

Delete api credentials delete

Deletes a specified API credential. Currently, removes the ability to access the API. Only ACCOUNT_HOLDER can invoke this API. For authentication use account credentials.

path

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

parameters

  • id integer required

    An id of an API credential

Sample Code

              
                

using CallfireApiClient;

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

Example Request

                  
                    

!/usr/bin/env bash

curl -u "account_login:account_password" -H "Content-Type:application/json" -X DELETE "https://api.callfire.com/v2/me/api/credentials/425836003"

Example Response

                    
                      

204 - No Content

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(425836003L); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('account-login', 'account-password');

client.ready(() => { client.me.deleteApiCredential({id: 425836003}) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("account_login", "account_password");
    $request = $client->deleteApiCredential();
    $request->getOperationConfig()->setPathParameters(array("id" => 425836003));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('account-login', 'account-password') client.me.deleteApiCredential(id=425836003)

Disable specified API credentials post

Disables a specified API credential. Currently, removes the ability to access the API. Only ACCOUNT_HOLDER can invoke this API. For authentication use account credentials.

path

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

parameters

  • id integer required

    An id of an API credential

Sample Code

              
                
              
          

Example Request

                  
                    
                  
              

Example Response

                    
                      
                    
                

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Enable specified API credentials post

Enables a specified API credential. Currently, adds the ability to access the API. Only ACCOUNT_HOLDER can invoke this API. For authentication use account credentials.

path

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

parameters

  • id integer required

    An id of an API credential

Sample Code

              
                
              
          

Example Request

                  
                    
                  
              

Example Response

                    
                      
                    
                

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

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. For authentication use api credentials.

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

              
                

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 = new DateTime(2037, 12, 31, 20, 53, 20), IntervalEnd = new DateTime(2038, 1, 1, 8, 0, 0) }; CreditsUsage creditsUsage = client.MeApi.GetCreditUsage(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "api_login:api_password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/me/billing/credit-usage?intervalBegin=2145905600000&intervalEnd=2145945600000"

Example Response

                    
                      

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

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; import java.util.GregorianCalendar;

class ApiClientSample { public static void main(String[] args) { CallfireClient callfireClient = new CallfireClient("api_login", "api_password"); Date begin = new GregorianCalendar(2037, Calendar.DECEMBER, 31, 20, 53, 20).getTime(); Date end = new GregorianCalendar(2038, Calendar.JANUARY, 1, 8, 0, 0).getTime(); DateIntervalRequest request = DateIntervalRequest.create() .intervalBegin(begin) .intervalEnd(end) .build(); CreditsUsage creditsUsage = callfireClient.meApi().getCreditUsage(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.me.getCreditUsage({ intervalBegin: 2145905600000, intervalEnd: 2145945600000 }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("api_login", "api_password");
    $request = $client->getCreditUsage();
    $request->getOperationConfig()->setQueryParameters(array("intervalBegin" => 2145905600000,
                                                             "intervalEnd" => 2145945600000));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.me.getCreditUsage(

# tim in unix milliseconds
intervalBegin=2145905600000,
intervalEnd=2145945600000

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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. For authentication use api credentials.

path

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

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 "api_login:api_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 }

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

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.me.getBillingPlanUsage() .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("api_login", "api_password");
    $request = $client->getBillingPlanUsage();
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.me.getBillingPlanUsage().result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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. For authentication use api credentials.

path

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

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 "api_login:api_password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/me/callerids"

Example Response

                    
                      

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

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

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.me.getCallerIds() .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("api_login", "api_password");
    $request = $client->getCallerIds();
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.me.getCallerIds().result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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. For authentication use api credentials.

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

              
                

using CallfireApiClient;

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

Example Request

                  
                    

!/usr/bin/env bash

curl -u "api_login:api_password" -H "Content-Type:application/json" -X POST "https://api.callfire.com/v2/me/callerids/12132000384"

Example Response

                    
                      

200 OK - No Response

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 = "12132000384"; callfireClient.meApi().sendVerificationCode(phoneNumber); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.me.sendVerificationCodeToCallerId({callerid: '12132000384'}) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("api_login", "api_password");
    $request = $client->sendVerificationCodeToCallerId();
    $request->getOperationConfig()->setPathParameters(array("callerid" => "12132000384"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.me.sendVerificationCodeToCallerId(callerid='12132000384').result()

see sample JSON response for this API

on 'curl' samples tab

print(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. For authentication use api credentials.

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

              
                

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 = "12132000384", VerificationCode = "1234" }; bool? verified = client.MeApi.VerifyCallerId(request); } }

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

true

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 = "12132000384"; CallerIdVerificationRequest request = CallerIdVerificationRequest.create() .callerId(phoneNumber) .verificationCode("1234") .build(); Boolean verified = callfireClient.meApi().verifyCallerId(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.me.verifyCallerId({ callerid: '12132000384', body: { verificationCode: 1234 } }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("api_login", "api_password");
    $request = $client->verifyCallerId();
    $request->getOperationConfig()->setPathParameters(array("callerid" => "12132000384"));
    $body = '{
                "verificationCode":"1234"
             }';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.me.verifyCallerId( callerid='12132000384', body={ 'verificationCode': 1234 } ).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

parameters

  • file file required

    Binary media file

  • name string

    A name of a media 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("/image1.bmp", "test image"); } }

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

{ "id": 1234 }

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("/image1.bmp"); // second argument is filename, in case you don't specify it filename will be taken from the path ResourceId id = client.mediaApi().upload(file, "test image"); } }

Sample Code

              
                

'strict'

const fs = require('fs'); const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.media.createMedia({ name: 'my-file', // for nodejs environment // file: fs.createReadStream('./myfile.wav') // for browser environment // file: new Blob([/ binary data /], {type: 'audio/wav'}) }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->createMedia();
    $request->getOperationConfig()->setFileUpload(__dir__.'\image1.bmp', 'test image');
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.media.createMedia( name='test image', file=open('image1.bmp', 'rb') ).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

Find media get

Find media files created by user

path

  • https://api.callfire.com/v2/media 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

    value to filter file names again; this value is used to check if the filename contains the filter 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

              
                

using System; 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 FindMediaRequest
    {
        Filter = "image1.jpeg"
    };

    Page<Media> media = client.MediaApi.Find(request);
    // check media.Items for stored data
}

}

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -X GET "https://api.callfire.com/v2/media?filter=image1.jpeg"

Example Response

                    
                      

{ "items":[ { "id":150003, "name":"image1", "created":1537878116000, "lengthInBytes":55744, "mediaType":"image/jpeg", "publicUrl":"https://api.callfire.com/v2/media/public/5a6.jpeg" } ], "limit":100, "offset":0, "totalCount":1 }

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.callstexts.model.Media; import com.callfire.api.client.api.callstexts.model.request.FindMediaRequest; import com.callfire.api.client.api.common.model.Page;

class ApiClientSample { public static void main(String[] args) throws ParseException { CallfireClient client = new CallfireClient("api_login", "api_password");

    FindMediaRequest request = FindMediaRequest.create()
            .filter("image1.jpeg")
            .build();

    Page<Media> media = client.mediaApi().find(request);
    // check media.getItems() list for stored data
}

}

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.media.findMedia({ filter:'image1.jpeg' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample { public static function main() { $client = \CallFire\Api\DocumentedClient::createClient("login", "password"); $request = $client->findMedia(); $request->getOperationConfig()->setQueryParameters(array( "filter" => "image1.jpeg" )); $result = $client->request($request); $json = json_decode($result->getBody()); } }

Sample Code

              
                

from callfire.client import CallfireClient client = CallfireClient('api-login', 'api-password')

get account info

response = client.media.findMedia( filter='image1.jpeg' ).result()

see sample JSON response for this APIon 'curl' samples tab

print(response)

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

              
                

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(379506003, MediaType.UNKNOWN); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/media/public/f733daab-fc05-470d-abe6-87cd136599ad.mp3"

Example Response

                    
                      

binary file response

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 is = client.mediaApi().getData("f733daab-fc05-470d-abe6-87cd136599ad", MediaType.MP3); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.media.getMediaDataByKey({ key: 'f733daab-fc05-470d-abe6-87cd136599ad', extension: 'mp3' }) .then((response) => { // returns binary response console.log(response.data); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getMediaDataByKey();
    $request->getOperationConfig()->setPathParameters(array("key" => "f733daab-fc05-470d-abe6-87cd136599ad",
                                                            "extension" => "mp3"));
    //Available media types:
    //JPEG("jpeg", "image/jpeg"),
    //PNG("png", "image/png"),
    //BMP("bmp", "image/bmp"),
    //GIF("gif", "image/gif"),
    //MP4("mp4", "video/mp4"),
    //M4A("m4a", "audio/m4a"),
    //MP3("mp3", "audio/mp3"),
    //WAV("wav", "audio/x-wav"),
    //UNKNOWN("unknown", "application/octet-stream");
    $result = $client->request($request);
}

}

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.media.getMediaDataByKey( key='f733daab-fc05-470d-abe6-87cd136599ad', extension='mp3' ).result()

see sample JSON response for this API

on 'curl' samples tab

print(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

              
                

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(379506003, "name,publicUrl"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/media/379506003?fields=name,publicUrl"

Example Response

                    
                      

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

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(379506003L, "name,publicUrl"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.media.getMedia({ id: 379506003, // return only specific fields fields: 'name,publicUrl' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getMedia();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003));
    $request->getOperationConfig()->setQueryParameters(array("fields" => "name,publicUrl"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.media.getMedia( id=379506003,

# return only specific fields
fields='name,publicUrl'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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(379506003, MediaType.MP3); } }

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

binary file response

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 is = client.mediaApi().getData(617067920003L, MediaType.MP3); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.media.getMediaData({ id: 379506003, extension: 'mp3' }) .then((response) => { // returns binary response console.log(response.data); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getMediaData();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003,
                                                            "extension" => "mp3"));
    //Available media types:
    //JPEG("jpeg", "image/jpeg"),
    //PNG("png", "image/png"),
    //BMP("bmp", "image/bmp"),
    //GIF("gif", "image/gif"),
    //MP4("mp4", "video/mp4"),
    //M4A("m4a", "audio/m4a"),
    //MP3("mp3", "audio/mp3"),
    //WAV("wav", "audio/x-wav"),
    //UNKNOWN("unknown", "application/octet-stream");
    $result = $client->request($request);
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.media.getMediaData( id=379506003, extension='mp3' ).result()

see sample JSON response for this API

on 'curl' samples tab

print(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

              
                

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/379506003/file"

Example Response

                    
                      

binary file response

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 is = client.mediaApi().getData(379506003L, MediaType.UNKNOWN); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.media.getMediaDataBinary({id: 379506003}) .then((response) => { // returns binary response console.log(response.data); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getMediaDataBinary();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003));
    $result = $client->request($request);
}

}

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.media.getMediaDataBinary(id=379506003).result()

see sample JSON response for this API

on 'curl' samples tab

print(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

  • labelName string

    A label name

  • tollFree boolean

    ~

  • 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

              
                

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 { Prefix = "14245", City = "Los Angeles", State = "CA", Zipcode = "90940", Lata = "123", RateCenter = "123", LabelName = "my label", Offset = 0, Limit = 10, Fields = "items(number,nationalFormat,leaseBegin,leaseEnd,region/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?prefix=14245&city=Los Angeles&state=CA&zipcode=90940&lata=123&rateCenter=123&labelName=my label&offset=0&limit=10&fields=items(number,nationalFormat,leaseBegin,leaseEnd,region/city)"

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 }

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() .prefix("14245") .city("Los Angeles") .state("CA") .zipcode("90940") .lata("123") .rateCenter("123") .labelName("my label") .offset(0L) .limit(10L) .fields("items(number,nationalFormat,leaseBegin,leaseEnd,region/city)") .build(); Page leases = client.numberLeasesApi().find(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.numbers.findNumberLeases({ // filter by 4-7 digit prefix prefix: '14245', // filter by city city: 'Los Angeles', // filter by state state: 'CA', // filter by zipcode zipcode: '90940', // filter by local access and transport area (LATA) lata: '123', // filter by rate center rateCenter: '123', // filter by label labelName: 'my label', // search offset offset: 0, // return 10 items per request limit: 10, // return only specific fields fields: 'items(number,nationalFormat,leaseBegin,leaseEnd,region/city)' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->findNumberLeases();
    $request->getOperationConfig()->setQueryParameters(array("prefix" => "14245",
                                                             "city" => "Los Angeles",
                                                             "state" => "CA",
                                                             "zipcode" => "90940",
                                                             "lata" => "123",
                                                             "rateCenter" => "123",
                                                             "labelName" => "my label",
                                                             "offset" => 0,
                                                             "limit" => 10,
                                                             "fields" => "items(number,nationalFormat,leaseBegin,leaseEnd,region/city)"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.numbers.findNumberLeases(

# filter by 4-7 digit prefix
prefix='14245',
# filter by city
city='Los Angeles',
# filter by state
state='CA',
# filter by zipcode
zipcode='90940',
# filter by local access and transport area (LATA)
lata='123',
# filter by rate center
rateCenter='123',
# filter by label
labelName='my label',
# search offset
offset=0,
# return 10 items per request
limit=10,
# return only specific fields
fields='items(number,nationalFormat,leaseBegin,leaseEnd,region/city)'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

  • 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

              
                

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() { Prefix = "14245", City = "Los Angeles", State = "CA", Zipcode = "90940", Lata = "123", RateCenter = "123", LabelName = "my label", Offset = 0, Limit = 10, Fields = "items(number,configType)" }; 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?prefix=14245&city=Los Angeles&state=CA&zipcode=90940&lata=123&rateCenter=123&labelName=my label&offset=0&limit=10&fields=items(number,configType)"

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 }

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() .prefix("14245") .city("Los Angeles") .state("CA") .zipcode("90940") .lata("123") .rateCenter("123") .labelName("my label") .offset(0L) .limit(10L) .fields("items(number,configType)") .build(); CallfireClient client = new CallfireClient("api_login", "api_password"); Page configs = client.numberLeasesApi().findConfigs(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.numbers.findNumberLeaseConfigs({ // filter by 4-7 digit prefix prefix: '14245', // filter by city city: 'Los Angeles', // filter by state state: 'CA', // filter by zipcode zipcode: '90940', // filter by local access and transport area (LATA) lata: '123', // filter by rate center rateCenter: '123', // filter by label labelName: 'my label', // search offset offset: 0, // return 10 items per request limit: 10, // return only specific fields fields: 'items(number,configType)' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main(){
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->findNumberLeaseConfigs();
    $request->getOperationConfig()->setQueryParameters(array("prefix" => "14245",
                                                             "city" => "Los Angeles",
                                                             "state" => "CA",
                                                             "zipcode" => "90940",
                                                             "lata" => "123",
                                                             "rateCenter" => "123",
                                                             "labelName" => "my label",
                                                             "offset" => 0,
                                                             "limit" => 10,
                                                             "fields" => "items(number,configType)"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.numbers.findNumberLeaseConfigs(

# filter by 4-7 digit prefix
prefix='14245',
# filter by city
city='Los Angeles',
# filter by state
state='CA',
# filter by zipcode
zipcode='90940',
# filter by local access and transport area (LATA)
lata='123',
# filter by rate center
rateCenter='123',
# filter by label
labelName='my label',
# search offset
offset=0,
# return 10 items per request
limit=10,
# return only specific fields
fields='items(number,configType)'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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("12132000384", "number,configType"); } }

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/12132000384?fields=number,configType"

Example Response

                    
                      

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

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("12132000384", "number,configType"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.numbers.getNumberLeaseConfig({ number: '12132000384', // return only specific fields fields: 'number,configType' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getNumberLeaseConfig();
    $request->getOperationConfig()->setPathParameters(array("number" => "12132000384"));
    $request->getOperationConfig()->setQueryParameters(array("fields" => "number,configType"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.numbers.getNumberLeaseConfig( number='12132000384',

# return only specific fields
fields='number,configType'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

  • textInboundConfig ref

    ~

Sample Code

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.Numbers.Model; using CallfireApiClient.Api.Common.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 = false, Recorded = true, Voicemail = true, IntroSoundId = 10004001, WhisperSoundId = 10005002, VoicemailSoundId = 10006003, FailedTransferSoundId = 10007004, TransferNumbers = new List {"12135551122", "12135551189"}, WeeklySchedule = new WeeklySchedule() { StartTimeOfDay = new LocalTime { Hour = 10, Minute = 0, Second = 0 }, StopTimeOfDay = new LocalTime { Hour = 18, Minute = 0, Second = 0 }, DaysOfWeek = new HashSet { DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, DayOfWeek.FRIDAY }, TimeZone = "America/New_York" }, GoogleAnalytics = new GoogleAnalytics () { Domain = "domain - name", GoogleAccountId = "UA - XXXXX - 2X", Category = "Sales" } };

    // OR create IVR config
    IvrInboundConfig = new IvrInboundConfig
    {
        DialplanXml = @"
            <dialplan name=""Root"">
                <menu maxDigits=""1"" timeout=""3500"" name=""Live"">
                    <play type=""tts"" voice=""female1"">
                        Hello this is AB Advertising, please press 1 to transfer to our sales representative,
                        press 2 to contact clients support.
                    </play>
                    <keypress pressed=""1"">
                         <!-- user pressed 1, store this data in 'selected_menu' variable -->
                        <stash varname=""selected_menu"">sales</stash>
                        <play type=""tts"" voice=""female1"">
                            You will be transferred to sales representative in a moment. Please wait.
                        </play>
                        <transfer callerid=""${call.callerid}"" musiconhold=""blues"" mode=""ringall"">
                            15550004455
                        </transfer>
                    </keypress>
                    <keypress pressed=""2"" name=""kp_become_volonteer"">
                         <!-- user pressed 2, store this data in 'selected_menu' variable -->
                        <stash varname=""selected_menu"">support</stash>
                        <play type=""tts"" voice=""female1"">
                            You will be transferred to clients support. Please wait.
                        </play>
                        <transfer callerid=""${call.callerid}"" musiconhold=""blues"" mode=""ringall"">
                            15550005500
                        </transfer>
                    </keypress>
                     <!-- if pressed key is not specified in menu replay Live menu -->
                    <keypress pressed=""default"" name=""incorrect_Selection"">
                        <play type=""tts"" voice=""female1"">That is not a valid selection. Please try again.</play>
                        <goto name=""replay_Live"">Live</goto>
                    </keypress>
                </menu>
                <play type=""tts"" voice=""female1"">
                    Thank you for calling us. Have a good day.
                </play>
                <hangup name=""Hangup""/>
            </dialplan>
        "
    };

    NumberConfig config = new NumberConfig
    {
        Number = "19206596476",
        // depends on what type of configuration your need assign TRACKING or IVR config
        ConfigType = NumberConfig.NumberConfigType.TRACKING,
        CallTrackingConfig = callTrackingConfig
        // ConfigType = NumberConfig.NumberConfigType.IVR,
        // CallTrackingConfig = IvrInboundConfig
    };
    client.NumberLeasesApi.UpdateConfig(config);
}

}

Example Request

                  
                    

!/usr/bin/env bash

CallTracking example:

curl -u "username:password" -H "Content-Type:application/json" -X PUT -d ' { "configType":"TRACKING", "callTrackingConfig": { "screen":"false", "recorded":"true", "voicemail":"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"

IVR example:

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X PUT -d ' { "configType":"IVR", "ivrInboundConfig": { "dialplanXml":"

Hello this is AB Advertising, please press 1 to transfer to our sales repreentative, press 2 to contact clients support. sales You will be transferred to sales representative in a moment. Please wait. 15550004455 sales You will be transferred to clients support. Please wait. 15550005500 That is not a valid selection. Please try again. Live Thank you for calling us. Have a good day. " } }' "https://api.callfire.com/v2/numbers/leases/configs/19206596476"

Example Response

                    
                      

200 OK - No Response

Sample Code

              
                
              
          

Sample Code

              
                

import com.callfire.api.client.CallfireClient; import com.callfire.api.client.api.common.model.LocalTime; import com.callfire.api.client.api.common.model.WeeklySchedule; import com.callfire.api.client.api.numbers.model.CallTrackingConfig; import com.callfire.api.client.api.numbers.model.GoogleAnalytics; import com.callfire.api.client.api.numbers.model.NumberConfig;

import java.time.DayOfWeek; import java.util.Arrays; import java.util.HashSet;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); NumberConfig config = new NumberConfig(); config.setNumber("'19206596476'"); // create call tracking config CallTrackingConfig callTrackingConfig = new CallTrackingConfig(); callTrackingConfig.setScreen(false); callTrackingConfig.setRecorded(true); callTrackingConfig.setRecorded(true); callTrackingConfig.setVoicemail(true); callTrackingConfig.setIntroSoundId(10004001L); callTrackingConfig.setWhisperSoundId(10005002L); callTrackingConfig.setVoicemailSoundId(10006003L); callTrackingConfig.setFailedTransferSoundId(10007004L); callTrackingConfig.setTransferNumbers(Arrays.asList("'12135551122", "'12135551189'"));

    WeeklySchedule schedule = new WeeklySchedule();
    schedule.setStartTimeOfDay(new LocalTime(10, 0, 0));
    schedule.setStopTimeOfDay(new LocalTime(18, 0, 0));
    schedule.setDaysOfWeek(new HashSet<>(
            Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.THURSDAY, DayOfWeek.WEDNESDAY, DayOfWeek.FRIDAY)));
    schedule.setTimeZone("America/New_York");
    callTrackingConfig.setWeeklySchedule(schedule);

    GoogleAnalytics googleAnalytics = new GoogleAnalytics();
    googleAnalytics.setDomain("domain - name");
    googleAnalytics.setCategory("Sales");
    googleAnalytics.setGoogleAccountId("UA - XXXXX - 2X");
    callTrackingConfig.setGoogleAnalytics(googleAnalytics);

    // create IVR config
    // IvrInboundConfig ivrInboundConfig = new IvrInboundConfig();
    // ivrInboundConfig.setDialplanXml(buildDialplanXml());
    // config.setIvrInboundConfig(ivrInboundConfig);
    // config.setConfigType(NumberConfig.ConfigType.IVR);

    // depends on what type of configuration your need assign TRACKING or IVR config
    config.setConfigType(NumberConfig.ConfigType.TRACKING);
    config.setCallTrackingConfig(callTrackingConfig);
    // update number configuration
    client.numberLeasesApi().updateConfig(config);
}

private static String buildDialplanXml() {
    return
        " <dialplan name=\"Root\">                                                                                        "
                + " <menu maxDigits=\"1\" timeout=\"3500\" name=\"Live\">                                                     "
                + "     <play type=\"tts\" voice=\"female1\">                                                                 "
                + "         Hello this is AB Advertising, please press 1 to transfer to our sales representative,              "
                + "         press 2 to contact clients support.                                                               "
                + "      </play>                                                                                              "
                + "      <keypress pressed=\"1\">                                                                             "
                + "          <!-- user pressed 1, store this data in 'selected_menu' variable -->                             "
                + "          <stash varname=\"selected_menu\">sales</stash>                                                   "
                + "          <play type=\"tts\" voice=\"female1\">                                                            "
                + "              You will be transferred to sales representative in a moment. Please wait.                    "
                + "          </play>                                                                                          "
                + "          <transfer callerid=\"${call.callerid}\" musiconhold=\"blues\" mode=\"ringall\">                  "
                + "              15550004455                                                                                  "
                + "          </transfer>                                                                                      "
                + "          </keypress>                                                                                      "
                + "          <keypress pressed=\"2\" name=\"kp_become_volonteer\">                                            "
                + "              <!-- user pressed 2, store this data in 'selected_menu' variable -->                         "
                + "              <stash varname=\"selected_menu\">support</stash>                                             "
                + "              <play type=\"tts\" voice=\"female1\">                                                        "
                + "                  You will be transferred to clients support. Please wait.                                 "
                + "              </play>                                                                                      "
                + "              <transfer callerid=\"${call.callerid}\" musiconhold=\"blues\" mode=\"ringall\">              "
                + "                  15550005500                                                                              "
                + "              </transfer>                                                                                  "
                + "           </keypress>                                                                                     "
                + "           <!-- if pressed key is not specified in menu replay Live menu -->                               "
                + "           <keypress pressed=\"default\" name=\"incorrect_Selection\">                                     "
                + "               <play type=\"tts\" voice=\"female1\">That is not a valid selection. Please try again.</play>"
                + "               <goto name=\"replay_Live\">Live</goto>                                                      "
                + "           </keypress>                                                                                     "
                + " </menu>                                                                                                   "
                + " <play type=\"tts\" voice=\"female1\">                                                                     "
                + "     Thank you for calling us. Have a good day.                                                            "
                + " </play>                                                                                                   "
                + " <hangup name=\"Hangup\"/>                                                                                 "
                + " </dialplan>                                                                                               ";
}

}

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.numbers.updateNumberLeaseConfig({ number: '19206596476', body: { configType: 'TRACKING', callTrackingConfig: { screen: false, recorded: true, voicemail: 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' } }

    // depends on what type of configuration your need assign TRACKING or IVR config
    //  configType: 'IVR',
    //  ivrInboundConfig: {
    //      dialplanXml: '<dialplan name="Root"> <menu maxDigits="1" timeout="3500" name="Live"> <play type="tts" voice="female1"> Hello this is AB Advertising, please press 1 to transfer to our sales repreentative, press 2 to contact clients support. </play> <keypress pressed="1"> <stash varname="selected_menu">sales</stash> <play type="tts" voice="female1"> You will be transferred to sales representative in a moment. Please wait. </play> <transfer callerid="${call.callerid}" musiconhold="blues" mode="ringall"> 15550004455 </transfer> </keypress> <keypress pressed="2" name="kp_become_volonteer"> <stash varname="selected_menu">sales</stash> <play type="tts" voice="female1"> You will be transferred to clients support. Please wait. </play> <transfer callerid="${call.callerid}" musiconhold="blues" mode="ringall"> 15550005500 </transfer> </keypress> <keypress pressed="default" name="incorrect_Selection"> <play type="tts" voice="female1">That is not a valid selection. Please try again.</play> <goto name="replay_Live">Live</goto> </keypress> </menu> <play type="tts" voice="female1"> Thank you for calling us. Have a good day. </play> <hangup name="Hangup"/> </dialplan> '
    //  }
  }
})
  .then((response) => {
    console.log(response.obj);
  })
  .catch((err) => {
    console.log('request error ' + err.data);
  });

}, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->updateNumberLeaseConfig();
    $request->getOperationConfig()->setPathParameters(array("number" => "19206596476"));
    $body = '{
                "configType":"TRACKING",
                "callTrackingConfig":
                {
                    "screen":"false",
                    "recorded":"true",
                    "voicemail":"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"
                    }
                }
             }';
  // depends on what type of configuration your need assign TRACKING or IVR config
  //  $body = '{
  //              "configType":"IVR",
  //              "ivrInboundConfig":
  //              {
  //                  "dialplanXml":"<dialplan name=\"Root\"> <menu maxDigits=\"1\" timeout=\"3500\" name=\"Live\"> <play type=\"tts\" voice=\"female1\"> Hello this is AB Advertising, please press 1 to transfer to our sales repreentative, press 2 to contact clients support. </play> <keypress pressed=\"1\"> <stash varname=\"selected_menu\">sales</stash> <play type=\"tts\" voice=\"female1\"> You will be transferred to sales representative in a moment. Please wait. </play> <transfer callerid=\"${call.callerid}\" musiconhold=\"blues\" mode=\"ringall\"> 15550004455 </transfer> </keypress> <keypress pressed=\"2\" name=\"kp_become_volonteer\"> <stash varname=\"selected_menu\">sales</stash> <play type=\"tts\" voice=\"female1\"> You will be transferred to clients support. Please wait. </play> <transfer callerid=\"${call.callerid}\" musiconhold=\"blues\" mode=\"ringall\"> 15550005500 </transfer> </keypress> <keypress pressed=\"default\" name=\"incorrect_Selection\"> <play type=\"tts\" voice=\"female1\">That is not a valid selection. Please try again.</play> <goto name=\"replay_Live\">Live</goto> </keypress> </menu> <play type=\"tts\" voice=\"female1\"> Thank you for calling us. Have a good day. </play> <hangup name=\"Hangup\"/> </dialplan> "
  //              }
  //           }';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.numbers.updateNumberLeaseConfig( number='19206596476', body={ 'configType': 'TRACKING', 'callTrackingConfig': { 'screen': False, 'recorded': True, 'voicemail': 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' } }

    # depends on what type of configuration your need assign TRACKING or IVR config
    # body={
    #    'configType': 'IVR',
    #    'ivrInboundConfig': {
    #       'dialplanXml': '<dialplan name="Root"> <menu maxDigits="1" timeout="3500" name="Live"> <play type="tts" voice="female1"> Hello this is AB Advertising, please press 1 to transfer to our sales repreentative, press 2 to contact clients support. </play> <keypress pressed="1"> <stash varname="selected_menu">sales</stash> <play type="tts" voice="female1"> You will be transferred to sales representative in a moment. Please wait. </play> <transfer callerid="${call.callerid}" musiconhold="blues" mode="ringall"> 15550004455 </transfer> </keypress> <keypress pressed="2" name="kp_become_volonteer"> <stash varname="selected_menu">sales</stash> <play type="tts" voice="female1"> You will be transferred to clients support. Please wait. </play> <transfer callerid="${call.callerid}" musiconhold="blues" mode="ringall"> 15550005500 </transfer> </keypress> <keypress pressed="default" name="incorrect_Selection"> <play type="tts" voice="female1">That is not a valid selection. Please try again.</play> <goto name="replay_Live">Live</goto> </keypress> </menu> <play type="tts" voice="female1"> Thank you for calling us. Have a good day. </play> <hangup name="Hangup"/> </dialplan> '
    #    }
    # }
}

).result()

Find a specific lease get

Returns a single NumberLease instance for a given 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

              
                

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("12132000384", "number,nationalFormat,leaseBegin,leaseEnd,region/city"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/numbers/leases/12132000384?fields=number,nationalFormat,leaseBegin,leaseEnd,region/city"

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" }

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("12132000384", "number,nationalFormat,leaseBegin,leaseEnd,region/city"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.numbers.getNumberLease({ number: '12132000384', // return only specific fields fields: 'number,nationalFormat,leaseBegin,leaseEnd,region/city' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getNumberLease();
    $request->getOperationConfig()->setPathParameters(array("number" => "12132000384"));
    $request->getOperationConfig()->setQueryParameters(array("fields" => "number,nationalFormat,leaseBegin,leaseEnd,region/city"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.numbers.getNumberLease( number='12132000384',

# return only specific fields
fields='number,nationalFormat,leaseBegin,leaseEnd,region/city'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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: 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: DISABLED, ENABLED

  • tollFree boolean

    A toll-free number

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 = "19206596476", AutoRenew = false, CallFeatureStatus = NumberLease.FeatureStatus.DISABLED }; 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

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("19206596476"); lease.setAutoRenew(false); lease.setCallFeatureStatus(NumberLease.FeatureStatus.DISABLED); client.numberLeasesApi().update(lease); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.numbers.updateNumberLease({ number: '19206596476', body: { callFeatureStatus: 'DISABLED', autoRenew: 'false' } }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->updateNumberLease();
    $request->getOperationConfig()->setPathParameters(array("number" => "19206596476"));
    $body = '{
                "callFeatureStatus":"DISABLED",
                "autoRenew":"false"
             }';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.numbers.updateNumberLease( number='19206596476', body={ 'callFeatureStatus': 'DISABLED', 'autoRenew': 'false' } ).result()

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. If all numbers with desirable zip code is already busy search will return available numbers with nearest zip code.

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

  • 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

              
                

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 { Prefix = "14245", City = "Los Angeles", State = "CA", Zipcode = "90940", Lata = "123", RateCenter = "123", Offset = 0, Limit = 10, Fields = "items(number,nationalFormat,leaseBegin,leaseEnd,region/city)" }; 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?prefix=14245&city=Los Angeles&state=CA&zipcode=90940&lata=123&rateCenter=123&offset=0&limit=10&fields=items(number,nationalFormat,leaseBegin,leaseEnd,region/city)"

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" } } ]

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"); FindNumbersLocalRequest request = FindNumbersLocalRequest.create() .prefix("14245") .city("Los Angeles") .state("CA") .zipcode("90940") .lata("123") .rateCenter("123") .offset(0L) .limit(10L) .fields("items(number,nationalFormat,leaseBegin,leaseEnd,region/city)") .build(); List numbers = client.numbersApi().findNumbersLocal(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.numbers.findNumbersLocal({ // filter by 4-7 digit prefix prefix: '14245', // filter by city city: 'Los Angeles', // filter by state state: 'CA', // filter by zipcode zipcode: '90940', // filter by local access and transport area (LATA) lata: '123', // filter by rate center rateCenter: '123', // search offset offset: 0, // return 10 items per request limit: 10, // return only specific fields fields: 'items(number,nationalFormat,leaseBegin,leaseEnd,region/city)' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->findNumbersLocal();
    $request->getOperationConfig()->setQueryParameters(array("prefix" => "14245",
                                                             "city" => "Los Angeles",
                                                             "state" => "CA",
                                                             "zipcode" => "90940",
                                                             "lata" => "123",
                                                             "rateCenter" => "123",
                                                             "offset" => 0,
                                                             "limit" => 10,
                                                             "fields" => "items(number,nationalFormat,leaseBegin,leaseEnd,region/city)"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.numbers.findNumbersLocal(

# filter by 4-7 digit prefix
prefix='14245',
# filter by city
city='Los Angeles',
# filter by state
state='CA',
# filter by zipcode
zipcode='90940',
# filter by local access and transport area (LATA)
lata='123',
# filter by rate center
rateCenter='123',
# search offset
offset=0,
# return 10 items per request
limit=10,
# return only specific fields
fields='items(number,nationalFormat,leaseBegin,leaseEnd,region/city)'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

  • 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

              
                

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 { Prefix = "14245", City = "Los Angeles", State = "CA", Zipcode = "90940", Lata = "123", RateCenter = "123", Offset = 0, Limit = 10, Fields = "items(number,nationalFormat,leaseBegin,leaseEnd,region/city)" }; 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?prefix=14245&city=Los Angeles&state=CA&zipcode=90940&lata=123&rateCenter=123&offset=0&limit=10&fields=items(number,nationalFormat,leaseBegin,leaseEnd,region/city)"

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 }

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() .prefix("14245") .city("Los Angeles") .state("CA") .zipcode("90940") .lata("123") .rateCenter("123") .offset(0L) .limit(10L) .fields("items(number,nationalFormat,leaseBegin,leaseEnd,region/city)") .build(); Page regions = client.numbersApi().findNumberRegions(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.numbers.findNumberRegions({ // filter by 4-7 digit prefix prefix: '14245', // filter by city city: 'Los Angeles', // filter by state state: 'CA', // filter by zipcode zipcode: '90940', // filter by local access and transport area (LATA) lata: '123', // filter by rate center rateCenter: '123', // search offset offset: 0, // return 10 items per request limit: 10, // return only specific fields fields: 'items(number,nationalFormat,leaseBegin,leaseEnd,region/city)' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->findNumberRegions();
    $request->getOperationConfig()->setQueryParameters(array("prefix" => "14245",
                                                             "city" => "Los Angeles",
                                                             "state" => "CA",
                                                             "zipcode" => "90940",
                                                             "lata" => "123",
                                                             "rateCenter" => "123",
                                                             "offset" => 0,
                                                             "limit" => 10,
                                                             "fields" => "items(number,nationalFormat,leaseBegin,leaseEnd,region/city)"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.numbers.findNumberRegions(

# filter by 4-7 digit prefix
prefix='14245',
# filter by city
city='Los Angeles',
# filter by state
state='CA',
# filter by zipcode
zipcode='90940',
# filter by local access and transport area (LATA)
lata='123',
# filter by rate center
rateCenter='123',
# search offset
offset=0,
# return 10 items per request
limit=10,
# return only specific fields
fields='items(number,nationalFormat,leaseBegin,leaseEnd,region/city)'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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 FindTollfreeNumbersRequest { Pattern = "87*", Limit = 10, Fields = "number" }; 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?pattern=87*&limit=10&fields=number"

Example Response

                    
                      

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

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.FindTollfreeNumbersRequest;

import java.util.List;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); FindTollfreeNumbersRequest request = FindTollfreeNumbersRequest.create() .pattern("87*") .limit(10L) .fields("number") .build(); List numbers = client.numbersApi().findNumbersTollfree(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.numbers.findNumbersTollfree({ // 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 ''). pattern: '87*', // return 10 items per request limit: 10, // return only specific fields fields: 'number' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->findNumbersTollfree();
    $request->getOperationConfig()->setQueryParameters(array("pattern" => "87*",
                                                             "limit" => 10,
                                                             "fields" => "number"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.numbers.findNumbersTollfree(

# 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 '*').
pattern='87*',
# return 10 items per request
limit=10,
# return only specific fields
fields='number'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

Find orders get

Searches for account orders

path

  • https://api.callfire.com/v2/orders 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.

  • status array

    Filter by order status, accepts multiple values in comma separated string, available values: [PROCESSING, FINISHED, PAYMENT_ERROR, VOID, WAIT_FOR_PAYMENT, PARTIALLY_ADJUSTED, ADJUSTED]

  • 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

              
                
              
          

Example Request

                  
                    
                  
              

Example Response

                    
                      
                    
                

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

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. Keyword should only consist of uppercase and lowercase letters and numbers. Number of characters must be greater than 2, but less than 65.

path

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

parameters

  • body {...} ref

    KeywordPurchaseRequest

  • keywords array

    A list of keywords

  • 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

              
                

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 }

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

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.orders.orderKeywords({ body: { keywords: ['SUN', 'MOON'] } }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->orderKeywords();
    $body = '{
                "keywords":
                [
                    "SUN", "MOON"
                ]
             }';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.orders.orderKeywords( body={ 'keywords': ['SUN', 'MOON'] } ).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

  • 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

  • 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

  • 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

              
                

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 }

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 request1 = NumberPurchaseRequest.create() .numbers(Arrays.asList("12131234567", "12131234568")) .build(); ResourceId resourceId1 = callfireClient.ordersApi().orderNumbers(request1);

    // request for buying numbers in specific area
    NumberPurchaseRequest request2 = NumberPurchaseRequest.create()
        .zipcode("90401")
        .localCount(2)
        .build();
    ResourceId resourceId2 = callfireClient.ordersApi().orderNumbers(request2);
}

}

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.orders.orderNumbers({ body: { // order particular numbers numbers: ['12131234567', '12131234568'] // or find and order area-specific numbers // localCount: '2', // zipcode: '90401' } }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request1 = $client->orderNumbers();
    $body = '{
                "numbers":
                [
                    "12131234567",
                    "12131234568"
                ]
             }';
    $request1->getOperationConfig()->setBodyParameter($body);
    $result1 = $client->request($request1);
    $json = json_decode($result1->getBody());

    $request2 = $client->orderNumbers();
    $body = '{
                "localCount":"2",
                "zipcode":"90401"
             }';
    $request2->getOperationConfig()->setBodyParameter($body);
    $result2 = $client->request($request2);
    $json = json_decode($result2->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.orders.orderNumbers( body={

    # order particular numbers
    'numbers': ['12131234567', '12131234568']
    # or find and order area-specific numbers
    # localCount: '2',
    # zipcode: '90401'
}

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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 = 379506003; NumberOrder order = client.OrdersApi.GetOrder(orderId, "status,totalCost"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/orders/379506003?fields=status,totalCost"

Example Response

                    
                      

{ "id": 10, "status": "FINISHED", "created": 1443402092000, "totalCost": 0.0, "localNumbers": { "ordered": 2, "unitCost": 0.0, "fulfilled": [ "13102305724", "13102306096" ] } }

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 = 379506003L; NumberOrder order = callfireClient.ordersApi().getOrder(orderId, "status,totalCost"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.orders.getOrder({ id: 379506003, // return only specific fields fields: 'status,totalCost' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getOrder();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003));
    $request->getOperationConfig()->setQueryParameters(array("fields" => "status,totalCost"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.orders.getOrder( id=379506003,

# return only specific fields
fields='status,totalCost'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

Get delivery reports by ad hoc criteria get

Get delivery reports

path

  • https://api.callfire.com/v2/reports/delivery GET

parameters

  • startDate string

    ~

  • endDate string

    ~

  • 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.

  • campaignId integer

    ~

  • fromNumber string

    ~

  • toNumber string

    ~

  • deliveryCategory string

    ~

  • deliveryState string

    ~

  • carrier string

    ~

  • messageText string

    ~

Sample Code

              
                
              
          

Example Request

                  
                    
                  
              

Example Response

                    
                      
                    
                

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

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. Example: 67076, 818818 etc

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.

  • strictValidation boolean

    Turns on strict validation for recipients

  • 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

  • fromNumber string

    ~

  • 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

              
                

using System.Collections.Generic; using CallfireApiClient; using CallfireApiClient.Api.CallsTexts.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 recipient1 = new TextRecipient { Message = "Hello World!", PhoneNumber = "12135551122" }; var recipient2 = new TextRecipient { ContactId = 122460000043 }; var recipient3 = new TextRecipient { PhoneNumber = "12135558090", Attributes = new Dictionary { {"custom_external_id", "30005044"}, {"custom_name", "Alice"} }, Message = "Hello, ${custom_name}!" }; var recipients = new List {recipient1, recipient2, recipient3}; var request = new SendTextsRequest { Recipients = recipients, CampaignId = 4050600003, DefaultMessage = "Hello!" }; IList texts = client.TextsApi.Send(request); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST -d ' [ { "phoneNumber":"12135551122", "message":"Hello World!" }, { "contactId":122460000043 }, { "phoneNumber":"12135558090", "attributes": { "custom_external_id": 30005044, "custom_name": "Alice" }, "message": "Hello, ${custom_name}!" } ]' "https://api.callfire.com/v2/texts?campaignId=4050600003&defaultMessage=Hello!"

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" } ] }

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.SendTextsRequest; import com.callfire.api.client.api.campaigns.model.TextRecipient;

import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map;

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

    TextRecipient r1 = new TextRecipient();
    r1.setPhoneNumber("12135551122");
    r1.setMessage("Hello World!");
    TextRecipient r2 = new TextRecipient();
    r2.setContactId(122460000043L);
    TextRecipient r3 = new TextRecipient();
    r1.setPhoneNumber("12135558090");
    r1.setMessage("Hello World!");
    Map<String,String> attrs = new HashMap<>();
    attrs.put("custom_external_id", "30005044");
    attrs.put("custom_name", "Alice");
    r3.setAttributes(attrs);
    r3.setMessage("Hello, ${custom_name}!");
    List<TextRecipient> recipients = Arrays.asList(r1, r2, r3);

    SendTextsRequest request = SendTextsRequest.create()
        .recipients(recipients)
        .campaignId(4050600003L)
        .defaultMessage("Hello!")
        .build();
    List<Text> texts = client.textsApi().send(request);
}

}

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.texts.sendTexts({ // default message for recipients w/o TextRecipient.message field defaultMessage: 'Hello!', // specify a campaignId to send texts through a previously created campaign // campaignId: 4050600003 body: [ { phoneNumber: '12135551122', message: 'Hello World!' }, // use an existing contact in CallFire account {contactId: 122460000043}, { phoneNumber: '12135558090', attributes: { custom_external_id: 30005044, custom_name: 'Alice' }, message: 'Hello, ${custom_name}!' }, ] }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->sendTexts();
    $request->getOperationConfig()->setQueryParameters(array("campaignId" => 4050600003,
                                                             "defaultMessage" => "Hello!"));
    $body = '[
                {
                    "phoneNumber":"12135551122",
                    "message":"Hello World!"
                },
                {
                    "contactId":122460000043
                },
                {
                    "phoneNumber":"12135558090",
                    "attributes":
                    {
                        "custom_external_id": 30005044,
                        "custom_name": "Alice"
                    },
                    "message": "Hello, ${custom_name}!"
                }
             ]';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.texts.sendTexts(

# default message for recipients w/o TextRecipient.message field
defaultMessage='Hello!',
# specify a campaignId to send texts through a previously created campaign
# campaignId: 4050600003
body=[
    {
        'phoneNumber': '12135551122',
        'message': 'Hello World!'
    },
    # use an existing contact in CallFire account
    {'contactId': 122460000043},
    {
        'phoneNumber': '12135558090',
        'attributes': {
            'custom_external_id': 30005044,
            'custom_name': 'Alice'
        },
        'message': 'Hello, ${custom_name}!'
    },
]

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

Find texts get

Searches for texts sent or received by user. Use "campaignId=0" 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

  • 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

  • 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

              
                

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

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new FindTextsRequest { Id = new List {11646003, 12646003, 13776003}, CampaignId = 449060003, BatchId = 447060003, ToNumber = "12136666123", FromNumber = "12135551126", Label = "my label", States = new List {StateType.FINISHED, StateType.READY, StateType.INVALID}, Results = new List {TextRecord.TextResult.RECEIVED}, Inbound = true, IntervalBegin = new DateTime(2016, 9, 13, 15, 50, 17), IntervalEnd = new DateTime(2016, 9, 13, 15, 50, 17), Offset = 0, Limit = 10, Fields = "items(id,fromNumber,toNumber,modified,message)" }; 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?id=11646003&id=12646003&id=13776003&campaignId=449060003&batchId=447060003&fromNumber=12135551126&toNumber=12136666123&label=my label&states=READY,FINISHED,INVALID&results=RECEIVED&inbound=true&intervalBegin=1473781817000&intervalEnd=1473781817000&offset=0&limit=10&fields=items(id,fromNumber,toNumber,modified,message)"

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 }

Sample Code

              
                
              
          

Sample Code

              
                

import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Arrays;

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 static com.callfire.api.client.api.callstexts.model.Action.State; import static com.callfire.api.client.api.callstexts.model.TextRecord.TextResult;

class ApiClientSample { public static void main(String[] args) throws ParseException { CallfireClient client = new CallfireClient("api_login", "api_password"); FindTextsRequest request = FindTextsRequest.create() .id(Arrays.asList(11646003L, 12646003L, 13776003L)) .campaignId(449060003L) .batchId(447060003L) .fromNumber("12135551126") .toNumber("12136666123") .label("my label") .states(Arrays.asList(State.READY, State.FINISHED, State.INVALID)) .results(Arrays.asList(TextResult.RECEIVED)) .inbound(true) .intervalBegin(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("2016-09-13 15:50:17")) .intervalEnd(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("2016-09-13 15:50:17")) .offset(0L) .limit(10L) .fields("items(id,fromNumber,toNumber,modified,message)") .build(); Page texts = client.textsApi().find(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.texts.findTexts({ // filter by text ids id: [ 11646003, 12646003, 13776003 ], // specify id of a campaign, queries for texts inside a particular campaign. // do not set to list texts of all campaigns or 0 for a default campaign campaignId: 449060003, // queries for texts which are used in the particular contact batch batchId: 447060003, // filter by fromNumber fromNumber: '12135551126', // filter by toNumber toNumber: '12136666123', // filter by label label: 'my label', // filter by text state states: 'READY,FINISHED,INVALID', // filter by text result results: 'RECEIVED', // filter only inbound actions inbound: true, // filter by time interval intervalBegin: 1473781817000, // filter by time interval intervalEnd: 1473781817000, // search offset offset: 0, // return 10 items per request limit: 10, // return only specific fields fields: 'items(id,fromNumber,toNumber,modified,message)' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->findTexts();
    $request->getOperationConfig()->setQueryParameters(array("id" => 11646003,
                                                             "id" => 12646003,
                                                             "id" => 13776003,
                                                             "campaignId" => 449060003,
                                                             "batchId" => 447060003,
                                                             "fromNumber" => "12135551126",
                                                             "toNumber" => "12136666123",
                                                             "label" => "my label",
                                                             "states" => "READY,FINISHED,INVALID",
                                                             "results" => "RECEIVED",
                                                             "inbound" => true,
                                                             "intervalBegin" => 1473781817000,
                                                             "intervalEnd" => 1473781817000,
                                                             "offset" => 0,
                                                             "limit" => 10,
                                                             "fields" => "items(id,fromNumber,toNumber,modified,message)"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.texts.findTexts(

# filter by text ids
id=[
    11646003,
    12646003,
    13776003
],
# specify  id of a campaign, queries for texts inside a particular campaign.
# do not set to list texts of all campaigns or 0 for a default campaign
campaignId=449060003,
# queries for texts which are used in the particular contact batch
batchId=447060003,
# filter by fromNumber
fromNumber='12135551126',
# filter by toNumber
toNumber='12136666123',
# filter by label
label='my label',
# filter by text state
states='READY,FINISHED,INVALID',
# filter by text result
results='RECEIVED',
# filter only inbound actions
inbound=True,
# filter by time interval
intervalBegin=1473781817000,
# filter by time interval
intervalEnd=1473781817000,
# search offset
offset=0,
# return 10 items per request
limit=10,
# return only specific fields
fields='items(id,fromNumber,toNumber,modified,message)'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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 = "67076", Message = "I am a leaf on the wind", Keyword = "CALLFIRE" }; 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 }

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("67076"); textAutoReply.setMessage("I am a leaf on the wind"); textAutoReply.setKeyword("CALLFIRE"); ResourceId resourceId = client.textAutoRepliesApi().create(textAutoReply); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.texts.createTextAutoReply({ body: { number: '67076', keyword: 'CALLFIRE', message: 'I am a leaf on the wind' } }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->createTextAutoReply();
    $body = '{
                "number":"67076",
                "keyword":"CALLFIRE",
                "message":"I am a leaf on the wind"
             }';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.texts.createTextAutoReply( body={ 'number': '67076', 'keyword': 'CALLFIRE', 'message': 'I am a leaf on the wind' } ).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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 = "12132000384", Offset = 0, Limit = 10, Fields = "items(id,match,keyword,message)" }; 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?number=12132000384&offset=0&limit=10&fields=items(id,match,keyword,message)"

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 }

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("12132000384") .offset(0L) .limit(10L) .fields("items(id,match,keyword,message)") .build(); Page textAutoReplies = client.textAutoRepliesApi().find(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.texts.findTextAutoReplys({ // filter by number number: 12132000384, // search offset offset: 0, // return 10 items per request limit: 10, // return only specific fields fields: 'items(id,match,keyword,message)' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->findTextAutoReplys();
    $request->getOperationConfig()->setQueryParameters(array("number" => "12132000384",
                                                             "offset" => 0,
                                                             "limit" => 10,
                                                             "fields" => "items(id,match,keyword,message)"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.texts.findTextAutoReplys(

# filter by number
number=12132000384,
# search offset
offset=0,
# return 10 items per request
limit=10,
# return only specific fields
fields='items(id,match,keyword,message)'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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(379506003, "keyword,message"); } }

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/379506003?fields=keyword,message"

Example Response

                    
                      

{ "id": 15, "keyword": "CALLFIRE", "message": "I am a leaf on the wind" }

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(379506003L, "keyword,message"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.texts.getTextAutoReply({ id: 379506003, // return only specific fields fields: 'keyword,message' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getTextAutoReply();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003));
    $request->getOperationConfig()->setQueryParameters(array("fields" => "keyword,message"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.texts.getTextAutoReply( id=379506003,

# return only specific fields
fields='keyword,message'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

using CallfireApiClient;

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

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/11646003"

Example Response

                    
                      

204 - No Content

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(11646003L); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.texts.deleteTextAutoReply({id: 11646003}) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->deleteTextAutoReply();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.texts.deleteTextAutoReply(id=11646003).result()

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).

  • strictValidation boolean

    Turns on strict validation for recipients. System will reply with BAD_REQUEST(400) if strictValidation = true and one of numbers didn't pass validation

  • 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 texts 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

              
                

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 = "19206596476", // attach custom labels if needed Labels = new List {"charity", "id-10003"}, // set message text Message = @"Hello {u_name} ...", // add new recipients Recipients = new List { new TextRecipient { PhoneNumber = "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 Attributes = new Dictionary { {"u_name", "Alice"}, {"age", "30"} } }, new TextRecipient { PhoneNumber = "13233834433", Attributes = new Dictionary { {"u_name", "Mark"}, {"age", "45"} } }, new TextRecipient { PhoneNumber = "13233834488", // 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 { {"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} ..." }' "https://api.callfire.com/v2/texts/broadcasts"

Example Response

                    
                      

{ "id": 13 }

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.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-10003"));
    // You can use default shared short code 67076 or uncomment the next line and set your own number
    broadcast.setFromNumber("19206596476");

    // 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} ...");

    // 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("13233834433");
    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
    recipient3.getAttributes().put("u_name", "Jane");
    recipient3.getAttributes().put("magic_number", "10");

    broadcast.setRecipients(Arrays.asList(recipient1, recipient2, recipient3));

    // create broadcast and start immediately
    ResourceId id = client.textBroadcastsApi().create(broadcast, true);
}

}

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.texts.createTextBroadcast({ // set start parameter to run broadcast immediately // start: true, body: { 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} ...' } }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->createTextBroadcast();
    $body = '{
                "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} ..."
             }';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.texts.createTextBroadcast(

# set start parameter to run broadcast immediately
# start: true,
body={
    '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} ...'
}

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

  • name string

    A name of text broadcast

  • label string

    A label of a text broadcast

  • running boolean

    Returns broadcasts only in running state.

  • scheduled boolean

    Specify whether the campaigns should be scheduled or not

  • 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

  • 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

              
                

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 = "broadcast name", Label = "my label", Running = true, Offset = 0, Limit = 10, Fields = "items(id,name,status,message)" }; 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?name=broadcast name&label=my label&running=true&offset=0&limit=10&fields=items(id,name,status,message)&scheduled=false&intervalBegin=1473781817000&intervalEnd=1473781817000"

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 }

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("broadcast name") .label("my label") .running(true) .offset(0L) .limit(10L) .fields("items(id,name,status,message)") .build(); Page broadcasts = client.textBroadcastsApi().find(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.texts.findTextBroadcasts({ // filter by name name: 'broadcast name', // filter by label label: 'my label', // filter only broadcasts in RUNNING state running: true, // search offset offset: 0, // return 10 items per request limit: 10, // return only specific fields fields: 'items(id,name,status,message)' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->findTextBroadcasts();
    $request->getOperationConfig()->setQueryParameters(array("name" => "broadcast name",
                                                             "label" => "my label",
                                                             "running" => true,
                                                             "offset" => 0,
                                                             "limit" => 10,
                                                             "fields" => "items(id,name,status,message)"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.texts.findTextBroadcasts(

# filter by name
name='broadcast name',
# filter by label
label='my label',
# filter only broadcasts in RUNNING state
running=True,
# search offset
offset=0,
# return 10 items per request
limit=10,
# return only specific fields
fields='items(id,name,status,message)'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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(379506003, "name,status,labels"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/texts/broadcasts/379506003?fields=name,status,labels"

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 }

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(379506003L, "name,status,labels"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.texts.getTextBroadcast({ id: 379506003, // return only specific fields fields: 'name,status,labels' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getTextBroadcast();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003));
    $request->getOperationConfig()->setQueryParameters(array("fields" => "name,status,labels"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.texts.getTextBroadcast( id=379506003,

# return only specific fields
fields='name,status,labels'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

  • strictValidation boolean

    Turns on strict validation for recipients. System will reply with BAD_REQUEST(400) if strictValidation = true and one of numbers didn't pass validation

  • 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 texts 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

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var broadcast = client.TextBroadcastsApi.Get(11646003); broadcast.Name = "Campaign name updated"; broadcast.Message = "a new test message"; // 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":"Campaign name updated", "message":"a new test message" }' "https://api.callfire.com/v2/texts/broadcasts/11646003"

Example Response

                    
                      

200 OK - No Response

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(11646003L); broadcast.setName("Campaign name updated"); broadcast.setMessage("a new test message"); client.textBroadcastsApi().update(broadcast); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.texts.updateTextBroadcast({ id: 11646003, body: { name: 'Campaign name updated', message: 'a new test message' } }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->updateTextBroadcast();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $body = '{
                "name":"Campaign name updated",
                "message":"a new test message"
             }';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.texts.updateTextBroadcast( id=11646003, body={ 'name': 'Campaign name updated', 'message': 'a new test message' } ).result()

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

              
                

using CallfireApiClient;

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

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

200 OK - No Response

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(11646003L); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.texts.archiveTextBroadcast({id: 11646003}) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->archiveTextBroadcast();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.texts.archiveTextBroadcast(id=11646003).result()

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

  • strictValidation boolean

    Turns on strict validation for recipients. System will reply with BAD_REQUEST(400) if strictValidation = true and one of numbers didn't pass validation

  • 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

              
                

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 = 11646003, Name = "contact batch for text", Recipients = new List { new TextRecipient {PhoneNumber = "12135551122"}, new TextRecipient {PhoneNumber = "12135553434"}, new TextRecipient { PhoneNumber = "12135558090", Attributes = new Dictionary { {"custom_external_id", "30005044"}, {"custom_property_1", "value1"} } } }, //or you can add contacts from particular contact list //ContactListId = 70055003 ScrubDuplicates = true }; 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" }, { "phoneNumber":"12135553434" }, { "phoneNumber":"12135558090", "attributes": { "custom_external_id": 30005044, "custom_property_1": "value1" } } ],

    # or you can add contacts from particular contact list
    # contactListId: 70055003
    "scrubDuplicates":"true"
}' "https://api.callfire.com/v2/texts/broadcasts/11646003/batches"

Example Response

                    
                      

{ "id": 10 }

Sample Code

              
                
              
          

Sample Code

              
                

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

import java.util.Arrays; import java.util.HashMap; import java.util.Map;

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

    TextRecipient recipient1 = new TextRecipient();
    recipient1.setPhoneNumber("12135551122");
    TextRecipient recipient2 = new TextRecipient();
    recipient2.setPhoneNumber("12135553434");
    TextRecipient recipient3 = new TextRecipient();
    recipient3.setPhoneNumber("12135558090");
    Map<String,String> attrs = new HashMap<>();
    attrs.put("custom_external_id", "30005044");
    attrs.put("custom_property_1", "value1");
    recipient3.setAttributes(attrs);
    AddBatchRequest request = AddBatchRequest.create()
        .campaignId(11646003L)
        .name("contact batch for text")
        .recipients(Arrays.asList(recipient1, recipient2, recipient3))
        //or you can add contacts from particular contact list
        //.contactListId(70055003L)
        .scrubDuplicates(true)
        .build();
    ResourceId resourceId = client.textBroadcastsApi().addBatch(request);
}

}

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.texts.addTextBroadcastBatch({ id: 11646003, body: { name: 'contact batch for text', recipients: [ {phoneNumber: '12135551122'}, {phoneNumber: '12135553434'}, { phoneNumber: '12135558090', attributes: { custom_external_id: 30005044, custom_property_1: 'value1' } }, ], // or you can add contacts from particular contact list // contactListId: 70055003, scrubDuplicates: true } }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->addTextBroadcastBatch();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $body = '{
                "name":"contact batch for text",
                "recipients":
                [
                    {
                        "phoneNumber":"12135551122"
                    },
                    {
                        "phoneNumber":"12135553434"
                    },
                    {
                        "phoneNumber":"12135558090",
                        "attributes":
                        {
                            "custom_external_id": 30005044,
                            "custom_property_1": "value1"
                        }
                    }
                ],
                # or you can add contacts from particular contact list
                # contactListId: 70055003
                "scrubDuplicates":"true"
             }';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.texts.addTextBroadcastBatch( id=11646003, body={ 'name': 'contact batch for text', 'recipients': [ {'phoneNumber': '12135551122'}, {'phoneNumber': '12135553434'}, { 'phoneNumber': '12135558090', 'attributes': { 'custom_external_id': 30005044, 'custom_property_1': 'value1' } }, ],

    # or you can add contacts from particular contact list
    # contactListId: 70055003,
    'scrubDuplicates': True
}

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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 = 11646003, Offset = 0, Limit = 10, Fields = "items(name,status,size,remaining)" }; 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/11646003/batches?offset=0&limit=10&fields=items(name,status,size,remaining)"

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 }

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(11646003L) .offset(0L) .limit(10L) .fields("items(name,status,size,remaining)") .build(); Page batches = client.textBroadcastsApi().getBatches(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.texts.getTextBroadcastBatches({ id: 11646003, // search offset offset: 0, // return 10 items per request limit: 10, // return only specific fields fields: 'items(name,status,size,remaining)' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getTextBroadcastBatches();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $request->getOperationConfig()->setQueryParameters(array("offset" => 0,
                                                             "limit" => 10,
                                                             "fields" => "items(name,status,size,remaining)"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.texts.getTextBroadcastBatches( id=11646003,

# search offset
offset=0,
# return 10 items per request
limit=10,
# return only specific fields
fields='items(name,status,size,remaining)'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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.

  • strictValidation boolean

    Turns on strict validation for recipients. System will reply with BAD_REQUEST(400) if strictValidation = true and one of numbers didn't pass validation

  • 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

  • fromNumber string

    ~

  • 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

              
                

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 = "12135551122"}, new TextRecipient {ContactId = 122460000043}, new TextRecipient { PhoneNumber = "12135558090", Attributes = new Dictionary { {"custom_external_id", "30005044"}, {"custom_property_1", "value1"} } }, }; var texts = client.TextBroadcastsApi.AddRecipients(11646003, recipients); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X POST -d ' [ { "phoneNumber":"12135551122" }, { "contactId":122460000043 }, { "phoneNumber":"12135558090", "attributes": { "custom_external_id": 30005044, "custom_property_1": "value1" } } ]' "https://api.callfire.com/v2/texts/broadcasts/11646003/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" } ] }

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.HashMap; import java.util.List; import java.util.Map;

class ApiClientSample { public static void main(String[] args) { CallfireClient client = new CallfireClient("api_login", "api_password"); TextRecipient recipient1 = new TextRecipient(); recipient1.setPhoneNumber("12135551122"); TextRecipient recipient2 = new TextRecipient(); recipient2.setContactId(122460000043L); TextRecipient recipient3 = new TextRecipient(); recipient3.setPhoneNumber("12135558090"); Map attrs = new HashMap<>(); attrs.put("custom_external_id", "30005044"); attrs.put("custom_property_1", "value1"); recipient3.setAttributes(attrs); List texts = client.textBroadcastsApi().addRecipients(11646003L, Arrays.asList(recipient1, recipient2, recipient3)); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.texts.addTextBroadcastRecipients({ id: 11646003, body: [ {phoneNumber: '12135551122'}, // use an existing contact in CallFire account {contactId: 122460000043}, { phoneNumber: '12135558090', attributes: { custom_external_id: 30005044, custom_property_1: 'value1' } }, ] }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->addTextBroadcastRecipients();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $body = '[
                {
                    "phoneNumber":"12135551122"
                },
                {
                    "contactId":122460000043
                },
                {
                    "phoneNumber":"12135558090",
                    "attributes":
                    {
                        "custom_external_id": 30005044,
                        "custom_property_1": "value1"
                    }
                }
             ]';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.texts.addTextBroadcastRecipients( id=11646003, body=[ {'phoneNumber': '12135551122'},

    # use an existing contact in CallFire account
    {'contactId': 122460000043},
    {
        'phoneNumber': '12135558090',
        'attributes': {
            'custom_external_id': 30005044,
            'custom_property_1': 'value1'
        }
    },
]

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

using CallfireApiClient;

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

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

200 OK - No Response

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(11646003L); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.texts.startTextBroadcast({id: 11646003}) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->startTextBroadcast();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.texts.startTextBroadcast(id=11646003).result()

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

              
                

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 = new DateTime(2016, 9, 13, 15, 50, 17); var end = new DateTime(2016, 9, 13, 15, 50, 17); BroadcastStats stats = client.TextBroadcastsApi.GetStats(11646003, "totalOutboundCount,billedAmount,sentCount", begin, end); } }

Example Request

Example Response

                    
                      

{ "totalOutboundCount": 2, "remainingOutboundCount": 0, "billedAmount": 0.50, "sentCount": 2, "unsentCount": 0, "recievedCount": 1, "doNotTextCount": 1, "tooBigCount": 0, "errorCount": 0 }

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.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date;

class ApiClientSample { public static void main(String[] args) throws ParseException { CallfireClient client = new CallfireClient("api_login", "api_password"); Date end = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("2016-09-13 15:50:17"); Date begin = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("2016-09-13 15:50:17"); // limit returned fields if needed String fields = "totalOutboundCount,billedAmount,sentCount"; TextBroadcastStats stats = client.textBroadcastsApi().getStats(11646003L, fields, begin, end); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.texts.getTextBroadcastStats({ id: 11646003, // filter by time interval begin: 1473781817000, // filter by time interval end: 1473781817000, // return only specific fields fields: 'totalOutboundCount,billedAmount,sentCount' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getTextBroadcastStats();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $request->getOperationConfig()->setQueryParameters(array("fields" => "totalOutboundCount,billedAmount,sentCount",
                                                             "begin" => 1473781817000,
                                                             "end" => 1473781817000));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.texts.getTextBroadcastStats( id=11646003,

# filter by time interval
begin=1473781817000,
# filter by time interval
end=1473781817000,
# return only specific fields
fields='totalOutboundCount,billedAmount,sentCount'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

using CallfireApiClient;

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

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

200 OK - No Response

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(11646003L); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.texts.stopTextBroadcast({id: 11646003}) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->stopTextBroadcast();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.texts.stopTextBroadcast(id=11646003).result()

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

              
                

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 = 5500030002, Offset = 0, Limit = 10, Fields = "items(fromNumber,toNumber,state,message)" }; 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/5500030002/texts?offset=0&limit=10&fields=items(fromNumber,toNumber,state,message)"

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 }

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(5500030002L) .offset(0L) .limit(10L) .fields("items(fromNumber,toNumber,state,message)") .build(); Page texts = client.textBroadcastsApi().findTexts(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.texts.getTextBroadcastTexts({ id: 11646003, // get texts assigned to particular contact batch batchId: 5500030002, // search offset offset: 0, // return 10 items per request limit: 10, // return only specific fields fields: 'items(fromNumber,toNumber,state,message)' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getTextBroadcastTexts();
    $request->getOperationConfig()->setPathParameters(array("id" => 5500030002));
    $request->getOperationConfig()->setQueryParameters(array("offset" => 0,
                                                             "limit" => 10,
                                                             "fields" => "items(fromNumber,toNumber,state,message)"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.texts.getTextBroadcastTexts( id=11646003,

# get texts assigned to particular contact batch
batchId=5500030002,
# search offset
offset=0,
# return 10 items per request
limit=10,
# return only specific fields
fields='items(fromNumber,toNumber,state,message)'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

Disable/enable undialed recipients in broadcast post

This operation lets the user to disable/enable undialed contacts in created broadcast

path

  • https://api.callfire.com/v2/texts/broadcasts/{id}/toggleRecipientsStatus POST

parameters

  • id integer required

    An id of a text broadcast

  • enable boolean

    Flag which indicate what to do with texts (true will enable texts in DISABLED status and vice versa)

  • 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

  • fromNumber string

    ~

  • phoneNumber string

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

Sample Code

              
                
              
          

Example Request

                  
                    
                  
              

Example Response

                    
                      
                    
                

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

Sample Code

              
                
              
          

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

              
                

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(379506003, "fromNumber,toNumber,modified,finalTextResult"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u "username:password" -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/texts/379506003?fields=fromNumber,toNumber,modified,finalTextResult"

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" } ] }

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(379506003L, "fromNumber,toNumber,modified,finalTextResult"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.texts.getText({ id: 379506003, // return only specific fields fields: 'fromNumber,toNumber,modified,finalTextResult' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getText();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003));
    $request->getOperationConfig()->setQueryParameters(array("fields" => "fromNumber,toNumber,modified,finalTextResult"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.texts.getText( id=379506003,

# return only specific fields
fields='fromNumber,toNumber,modified,finalTextResult'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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'], 'ContactList': ['validationFinished', 'validationFailed'], 'MonthlyRenewal': ['failed', 'finished'], 'LowBalance': ['failed', '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...).

  • expiresAt integer

    ~

  • 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

              
                

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 = "sms sent", Resource = ResourceType.OUTBOUND_TEXT, Events = new HashSet {ResourceEvent.FINISHED}, Callback = "https://callback-service.com/listener" }; 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 }

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("sms sent"); webhook.setResource(ResourceType.OUTBOUND_TEXT); webhook.getEvents().add(ResourceType.ResourceEvent.FINISHED); webhook.setCallback("https://callback-service.com/listener"); ResourceId id = client.webhooksApi().create(webhook); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.webhooks.createWebhook({ body: { name: 'sms sent', resource: 'OutboundText', events: ['Finished'], callback: 'https://callback-service.com/listener' } }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client =\CallFire\Api\DocumentedClient::createClient ("login", "password");
    $request = $client -> createWebhook();
    $body = '{
                "name":"Sms sent",
                "resource":"OutboundText",
                "events":["Finished"],
                "callback":"https://callback-service.com/listener"
             }';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.webhooks.createWebhook( body={ 'name': 'sms sent', 'resource': 'OutboundText', 'events': ['Finished'], 'callback': 'https://callback-service.com/listener' } ).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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', 'ContactList'

  • 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

              
                

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 { Name = "my webhook", Resource = ResourceType.TEXT_BROADCAST, Event = ResourceEvent.STARTED, Callback = "https://myservice/callback", Enabled = true, Offset = 0, Limit = 10, Fields = "items(id,name,callback)" }; 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?name=my webhook&resourse=TextBroadcast&event=Started&callback=https://myservice/callback&enabled=true&offset=0&limit=10&fields=items(id,name,callback)"

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 }

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.ResourceType; 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() .name("my webhook") .resource(ResourceType.TEXT_BROADCAST) .event(ResourceType.ResourceEvent.STARTED) .callback("https://myservice/callback") .enabled(true) .offset(0L) .limit(10L) .fields("items(id,name,callback)") .enabled(true) .build(); Page webhooks = client.webhooksApi().find(request); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.webhooks.findWebhooks({ // filter by webhook name name: 'my webhook', // filter by resource resource: 'TextBroadcast', // filter by event event: 'Started', // filter by callback URI callback: 'https://myservice/callback', // filter by enabled flag enabled: true, // search offset offset: 0, // return 10 items per request limit: 10, // return only specific fields fields: 'items(id,name,callback)' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->findWebhooks();
    $request->getOperationConfig()->setQueryParameters(array("name" => "my webhook",
                                                             "resource" => "TextBroadcast",
                                                             "event" => "Started",
                                                             "callback" => "https://myservice/callback",
                                                             "enabled" => true,
                                                             "offset" => 0,
                                                             "limit" => 10,
                                                             "fields" => "items(id,name,callback)"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.webhooks.findWebhooks(

# filter by webhook name
name='my webhook',
# filter by resource
resource='TextBroadcast',
# filter by event
event='Started',
# filter by callback URI
callback='https://myservice/callback',
# filter by enabled flag
enabled=True,
# search offset
offset=0,
# return 10 items per request
limit=10,
# return only specific fields
fields='items(id,name,callback)'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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'], 'ContactList': ['validationFinished', 'validationFailed'], 'MonthlyRenewal': ['failed', 'finished'], 'LowBalance': ['failed', '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

              
                

using CallfireApiClient;

public class ApiClientSample { public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var resources = client.WebhooksApi.FindWebhookResources("items(events)"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/webhooks/resources?fields=items(events)"

Example Response

                    
                      

{ "items": [ { "resource": "TextBroadcast", "events": [ "stop", "start" ] }, { "resource": "CallBroadcast", "events": [ "stop", "start" ] } ], "limit": 1000, "offset": 0, "totalCount": 2 }

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(events)"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.webhooks.findWebhookResources() .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->findWebhookResources();
    $request->getOperationConfig()->setQueryParameters(array("fields" => "items(events)"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.webhooks.findWebhookResources(fields='items(events)').result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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'], 'ContactList': ['validationFinished', 'validationFailed'], 'MonthlyRenewal': ['failed', 'finished'], 'LowBalance': ['failed', '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

              
                

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, "resource,events"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/webhooks/resources/CallBroadcast?fields=resource,events"

Example Response

                    
                      

{ "resource": "TextBroadcast", "events": [ "stop", "start" ] }

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,events"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.webhooks.getWebhookResource({ resource: 'CallBroadcast', // return only specific fields fields: 'resource,events' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getWebhookResource();
    $request->getOperationConfig()->setPathParameters(array("resource" => "CALL_BROADCAST"));
    $request->getOperationConfig()->setQueryParameters(array("fields" => "resource,events"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.webhooks.getWebhookResource( resource='CallBroadcast',

# return only specific fields
fields='resource,events'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

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(379506003, "name,callback"); } }

Example Request

                  
                    

!/usr/bin/env bash

curl -u username:password -H "Content-Type:application/json" -X GET "https://api.callfire.com/v2/webhooks/379506003?fields=name,callback"

Example Response

                    
                      

{ "id": 4321, "enabled": false, "name": "API hook", "resource": "TextBroadcast", "events": [ "stop", "start" ], "callback": "http://webhook.receiver.xyz/endpoint", "createdAt": 1443408255000, "updatedAt": 1443408255000 }

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(379506003L, "name,callback"); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.webhooks.getWebhook({ id: 379506003, // return only specific fields fields: 'name,callback' }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->getWebhook();
    $request->getOperationConfig()->setPathParameters(array("id" => 379506003));
    $request->getOperationConfig()->setQueryParameters(array("fields" => "name,callback"));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') response = client.webhooks.getWebhook( id=379506003,

# return only specific fields
fields='name,callback'

).result()

see sample JSON response for this API

on 'curl' samples tab

print(response)

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

              
                

using CallfireApiClient;

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

Example Request

                  
                    

!/usr/bin/env bash

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

Example Response

                    
                      

204 - No Content

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(11646003L); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.webhooks.deleteWebhook({id: 11646003}) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->deleteWebhook();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.webhooks.deleteWebhook(id=11646003)

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...).

  • expiresAt integer

    ~

  • 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

              
                

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 = 11646003, Name = "sms sent update", Resource = ResourceType.TEXT_BROADCAST, Events = new HashSet { ResourceEvent.FINISHED }, Callback = "https://callback-service.com/listener2" }; 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/11646003" -d ' { "name":"sms sent update", "events":["Finished"], "callback":"https://callback-service.com/listener2" }'

Example Response

                    
                      

200 OK - No Response

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(11646003L); webhook.setName("sms sent update"); webhook.getEvents().add(ResourceType.ResourceEvent.FINISHED); webhook.setCallback("https://callback-service.com/listener2"); client.webhooksApi().update(webhook); } }

Sample Code

              
                

'strict'

const CallfireClient = require('callfire-api-client-js'); const client = new CallfireClient('api-login', 'api-password');

client.ready(() => { client.webhooks.updateWebhook({ id: 11646003, body: { name: 'sms sent update', events: ['Finished'], callback: 'https://callback-service.com/listener2' } }) .then((response) => { console.log(response.obj); }) .catch((err) => { console.log('request error ' + err.data); }); }, (clientError) => { console.log('client error ' + clientError); } );

Sample Code

              
                

<?php

class ApiClientSample {

public static function main() {
    $client = \CallFire\Api\DocumentedClient::createClient("login", "password");
    $request = $client->updateWebhook();
    $request->getOperationConfig()->setPathParameters(array("id" => 11646003));
    $body = '{
                "name":"sms sent update",
                "events":["Finished"],
                "callback":"https://callback-service.com/listener2"
             }';
    $request->getOperationConfig()->setBodyParameter($body);
    $result = $client->request($request);
    $json = json_decode($result->getBody());
}

}

ApiClientSample::main();

Sample Code

              
                

from callfire.client import CallfireClient

client = CallfireClient('api-login', 'api-password') client.webhooks.updateWebhook( id=11646003, body={ 'name': 'sms sent update', 'events': ['Finished'], 'callback': 'https://callback-service.com/listener2' } )