CallFire Solutions

Get Subscription

Follow

GET SUBSCRIPTION

Gets an existing individual subscription by id

It returns a subscription registered to an account using subscriptionId, which was returned from a CreateSubscription request. The subscription returned contains information such as id, enabled, endpoint, filter, and more. See the Response Parameters table below for a complete list of the data that the GetBroadcast operation returns.

REQUEST PARAMETERS

ParameterDemo ValueDescriptionData Type
GetSubscription   Subscription request by unique ID object
Id Unique ID of resource long

RESPONSE PARAMETERS

ParameterDescriptionData Type
Subscription Subscribe to a CallFire postback notification event, such as 'textnotification', by registering a callback URI endpoint where events will get published to.  
Id Unique ID of Subscription long
Enabled Enable publishing of postback notifications for subscribed events. boolean
Endpoint Email or URI endpoint to publish notification event to. anyURI
NotificationFormat [XML, JSON, SOAP, EMAIL] NotificationFormat
TriggerEvent Event to trigger on[UNDEFINED_EVENT, INBOUND_CALL_FINISHED, INBOUND_TEXT_FINISHED, OUTBOUND_CALL_FINISHED, OUTBOUND_TEXT_FINISHED, CAMPAIGN_STARTED, CAMPAIGN_STOPPED, CAMPAIGN_FINISHED] SubscriptionTriggerEvent
SubscriptionFilter Filter the type of notification events published to postback URI endpoint.  
BroadcastId Broadcast ID to filter on long
BatchId Batch ID to filter on long
FromNumber From number (11 digit) or shortcode to filter on PhoneNumber
ToNumber E.164 11 digit phone number List[PhoneNumber]
Inbound Deprecated, use TriggerEvent boolean

EXAMPLE


using RestSharp;

namespace [your-namespace]
{
    public class [your-class]
    {
        public string GetSubscription()
        {
            long subscriptionId = 222046003; // Your Subscription Id here

            var client = new RestClient("https://www.callfire.com/api/1.1/rest/");
            client.Authenticator = new HttpBasicAuthenticator("YourLoginId", "password");

            var request = new RestRequest(string.Format("subscription/{0}", subscriptionId), Method.GET);

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

The XML returned is:

<?xml version="1.0" encoding="UTF-8"?> <r:Resource xmlns:r="http://api.callfire.com/resource" xmlns="http://api.callfire.com/data"> <Subscription id="222046003"> <Enabled>true</Enabled> <Endpoint>update_example@test.com</Endpoint> <NotificationFormat>XML</NotificationFormat> <TriggerEvent>INBOUND_TEXT_FINISHED</TriggerEvent> <SubscriptionFilter /> </Subscription> </r:Resource>

Have more questions? Submit a request

Comments