QUERY CALLS

Lists inbound and outbound calls

This operation queries for calls using standard ActionQuery, which filters on batchId, broadcastId, toNumber, and other parameters. It returns a list of calls and all associated information. See GetCall if you need to get just a single call action by id.

REQUEST PARAMETER

Parameter Data Type Demo Value Description
QueryCalls object Call request by query
MaxResults long 1000 Max number of results to return limited to 1000 (default: 1000)
FirstResult long 0 Start of next result set (default: 0)
BroadcastId long 1 BroadcastId to query on
BatchId long 1 BatchId to query on
State List[ActionState] FINISHED TIMEOUT List of Action States to query on[READY, SELECTED, CALLBACK, FINISHED, DNC, DUP, INVALID, TIMEOUT]
Result List[Result] SENT RECEIVED List of Results to query on[LA, AM, BUSY, DNC, XFER, XFER_LEG, NO_ANS, UNDIALED, INTERNAL_ERROR, CARRIER_ERROR, CARRIER_TEMP_ERROR, SD, POSTPONED]
Inbound boolean true Is call inbound
IntervalBegin dateTime 2012-01-01T21:32:52Z Beginning of DateTime interval to search on
IntervalEnd dateTime 2013-10-26T05:36:10Z End of DateTime interval to search on
FromNumber PhoneNumber 13105551212 E.164 11 digit number
ToNumber List[PhoneNumber] 18185551212 E.164 11 digit number
LabelName string MyLabel Label that result must have to be included

RESPONSE PARAMETERS

Parameter Data Type Description
CallQueryResult List of Calls returned from query
TotalResults long Results count
Call Call Information
Id long Unique ID of action
FromNumber PhoneNumber E.164 11 digit number or short code
ToNumber List[PhoneNumber] List of E.164 11 digit numbers space seperated
State ActionState Current State of Action[READY, SELECTED, CALLBACK, FINISHED, DNC, DUP, INVALID, TIMEOUT]
BatchId long Unique ID of Batch associated with Action
BroadcastId long Unique ID of Broadcast associated with Action
ContactId long Unique ID of Contact associated with Action
Inbound boolean Is inbound Action
Created dateTime DateTime Action was created 'CCYY-MM-DDThh:mm:ss[Z(+/-)hh:mm]'
Modified dateTime DateTime Action was modified 'CCYY-MM-DDThh:mm:ss[Z(+/-)hh:mm]'
FinalResult Result [LA, AM, BUSY, DNC, XFER, XFER_LEG, NO_ANS, UNDIALED, INTERNAL_ERROR, CARRIER_ERROR, CARRIER_TEMP_ERROR, SD, POSTPONED]
Label
Name string
CallRecord
Id long
Result Result [LA, AM, BUSY, DNC, XFER, XFER_LEG, NO_ANS, UNDIALED, INTERNAL_ERROR, CARRIER_ERROR, CARRIER_TEMP_ERROR, SD, POSTPONED]
FinishTime dateTime DateTime action finished in 'CCYY-MM-DDThh:mm:ss[Z(+/-)hh:mm]' format
BilledAmount float Credits charged for call or text
QuestionResponse Question / Response pair defined in IVR campaign with [stash] (https://www.callfire.com/help/docs/callfire-xml/tags/stash).
Question string IVR stash 'varname'
Response string IVR stash value associated with 'varname'
OriginateTime dateTime
AnswerTime dateTime
Duration int Duration of call in seconds
RecordingMeta Recordings are audio recorded during a call.
Id long
Name string
Created dateTime
LengthInSeconds int
Link string

EXAMPLE

using RestSharp;

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

            var request = new RestRequest("call", Method.GET);
            request.AddParameter("MaxResults", "5");
            request.AddParameter("State", "FINISHED");
            request.AddParameter("Result", "LA");
            request.AddParameter("Inbound", "false");

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

The XML returned is:

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

<r:ResourceList xmlns="http://api.callfire.com/data" xmlns:r="http://api.callfire.com/resource" totalResults="5">

    <Call id="209720137001">

       <FromNumber>12132609784</FromNumber>

       <ToNumber context="cf3-verify" verifyDigits="5307">14252163710</ToNumber>

       <State>FINISHED</State>

       <BroadcastId>1836940001</BroadcastId>

       <ContactId>165332795001</ContactId>

       <Inbound>false</Inbound>

       <Created>2014-05-19T15:25:36Z</Created>

       <Modified>2014-12-12T21:40:02Z</Modified>

       <FinalResult>LA</FinalResult>

       <CallRecord id="125746517001">

          <Result>LA</Result>

          <FinishTime>2014-05-19T15:26:20Z</FinishTime>

          <BilledAmount>0.0</BilledAmount>

          <OriginateTime>2014-05-19T15:25:37Z</OriginateTime>

          <AnswerTime>2014-05-19T15:25:44Z</AnswerTime>

          <Duration>36</Duration>

       </CallRecord>

    </Call>

</r:ResourceList>