Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 812 Bytes

02.subscriptions.md

File metadata and controls

21 lines (16 loc) · 812 Bytes

Subscriptions

Subscribe to Events

This example demonstrates how to subscribe to inbound text events. The same code applies to subscribing to any other type of events, with the TriggerEvent parameter changed appropriately.

var client = new CallfireClient("api-login", "api-password", CallfireClients.Rest);
var subscriptionClient = client.Subscription;

var endPoint = "http://example.com/subscribe.php";
var cfNotificationFormat = CfNotificationFormat.Xml;
var cfTriggerEvent = CfSubscriptionTriggerEvent.InboundTextFinished;
var cfSubscription = new CfSubscription(null, true, endPoint, cfNotificationFormat, cfTriggerEvent, null);

var cfSubscriptionRequest = new CfSubscriptionRequest(null, cfSubscription);
var id = subscriptionClient.CreateSubscription(cfSubscriptionRequest);