CallFire Solutions

Update Subscription

Follow

UPDATE SUBSCRIPTION

Updates an existing subscription by id

Use this operation to enable or disable notification events, change the notification endpoint URI, or change the filtering to receive only notifications for a subset of events.

The UpdateSubscription service call returns no response.

Request Parameters

ParameterDemo ValueDescriptionData Type
UpdateSubscription   Update Subscription using attached info object
RequestId Unique ID of web request needed for de-duping anyURI
Subscription   Subscribe to a CallFire postback notification event, such as 'textnotification', by registering a callback URI endpoint where events will get published to. object
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. object
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 UpdateSubscription()
        {
            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.PUT);
            request.AddParameter("Endpoint", "update_example@test.com");
            request.AddParameter("NotificationFormat", "XML");
            request.AddParameter("TriggerEvent", "INBOUND_TEXT_FINISHED");

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

The response code returned is:

204

Which means that the subscription has been updated successfully.

Have more questions? Submit a request

Comments