QUERY SUBSCRIPTIONS
Get a list of registered subscriptions
This operation returns a list of all subscriptions registered to an account. Subscriptions returned contain information such as id, enabled, endpoint, filter, and more. See the Response Parameters table below for a complete list of the data that the QuerySubscriptions operation returns.
REQUEST PARAMETERS
Parameter | Data Type | Demo Value | Description |
---|---|---|---|
QuerySubscriptions | object | Subscriptions 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) |
RESPONSE PARAMETERS
Parameter | Data Type | Description |
---|---|---|
SubscriptionQueryResult | List of Subscriptions returned from query | |
TotalResults | long | Results count |
Subscription | Subscribe to a CallFire postback notification event, such as 'textnotification', by registering a callback URI endpoint where events will get published to. | |
Id | long | Unique ID of Subscription |
Enabled | boolean | Enable publishing of postback notifications for subscribed events. |
Endpoint | anyURI | Email or URI endpoint to publish notification event to. |
NotificationFormat | NotificationFormat | [XML, JSON, SOAP, EMAIL] |
TriggerEvent | SubscriptionTriggerEvent | Event to trigger on[UNDEFINED_EVENT, INBOUND_CALL_FINISHED, INBOUND_TEXT_FINISHED, OUTBOUND_CALL_FINISHED, OUTBOUND_TEXT_FINISHED, CAMPAIGN_STARTED, CAMPAIGN_STOPPED, CAMPAIGN_FINISHED] |
SubscriptionFilter | Filter the type of notification events published to postback URI endpoint. | |
BroadcastId | long | Broadcast ID to filter on |
BatchId | long | Batch ID to filter on |
FromNumber | PhoneNumber | From number (11 digit) or shortcode to filter on |
ToNumber | List[PhoneNumber] | E.164 11 digit phone number |
Inbound | boolean | Deprecated, use TriggerEvent |
EXAMPLE
using RestSharp;
namespace [your-namespace]
{
public class [your-class]
{
public string QuerySubscriptions()
{
var client = new RestClient("https://www.callfire.com/api/1.1/rest/");
client.Authenticator = new HttpBasicAuthenticator("YourLoginId", "password");
var request = new RestRequest("subscription", Method.GET);
request.AddParameter("MaxResults", "50");
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="1">
<Subscription id="222046003">
<Enabled>true</Enabled>
<Endpoint>example@test.com</Endpoint>
<NotificationFormat>JSON</NotificationFormat>
<TriggerEvent>INBOUND_CALL_FINISHED</TriggerEvent>
<SubscriptionFilter/>
</Subscription>
</r:ResourceList>