The CallFire API provides a robust interface to control functionality available through the regular web interface, plus some controls which are not otherwise accessible.
This library provides a set of C# classes to interface with the CallFire API. Please refer to the API documentation for information on finding your API credentials.
There are two separate, but largely equivalent, endpoints by which you can access the CallFire API. These are the REST and SOAP APIs.
The REST API will be the primary API endpoint in our example documentation, but the examples are totally equivalent with the SOAP API.
If the REST API is used, the following configuration entry should be added:
<add key="CallFireRestRoute" value="https://www.callfire.com/api/1.1/rest/"/>This example demonstrates how to instantiate the REST API client, create a request object, and then invoke a request.
var client = new CallfireClient("api-login", "api-password", CallfireClients.Rest);
var broadcastClient = client.Broadcasts;
var cfQueryBroadcasts = new CfQueryBroadcasts();
var cfBroadcastQueryResult = broadcastClient.QueryBroadcasts(cfQueryBroadcasts);
foreach (var cfBroadcast in cfBroadcastQueryResult.Broadcast)
{
// Do something with each cfBroadcast
}Each request is codified into a request object (a sort of "criteria object"). Any parameters in the request object that are left null will not be specified to the API. Not all operations require a request object; some operations require only a resource identifier.
Also available is the SOAP interface to the API.
If the SOAP API is used, the following configuration entry should be added:
<add key="CallFireSoapRoute" value="https://www.callfire.com/api/1.1/soap12"/>This example is equivalent to the example for the REST client. The only difference in this case is the API client initialization.
var client = new CallfireClient("api-login", "api-password", CallfireClients.Soap);
var broadcastClient = client.Broadcasts;
var cfQueryBroadcasts = new CfQueryBroadcasts();
var cfBroadcastQueryResult = Client.QueryBroadcasts(cfQueryBroadcasts);
foreach (var cfBroadcast in cfBroadcastQueryResult.Broadcast)
{
// Do something with each cfBroadcast
}