MENU
CallFire - Your Message Delivered
Call Us! (877) 897-3473
CLOSE
  • Products
  • Pricing
  • Developers
  • Help
  • Log In
  • Sign Up
Call Us! (877) 897-3473

CreateSubscription

CallFire has a new API!

We are proud to announce the launch of our API 2.0! Learn more about our streamlined, transactional and broadcast APIs. This version of the API documentation will remain available for reference only. There will be no new development, only bug fixes. We highly recommend upgrading to our newer and more sophisticated documentation.

CallFire-API-Documentation

  • ▶/BroadcastService
    • CreateBroadcast
    • QueryBroadcasts
    • GetBroadcast
    • UpdateBroadcast
    • GetBroadcastStats
    • ControlBroadcast
    • CreateContactBatch
    • QueryContactBatches
    • GetContactBatch
    • ControlContactBatch
    • CreateBroadcastSchedule
    • QueryBroadcastSchedule
    • GetBroadcastSchedule
    • DeleteBroadcastSchedule
  • ▶/SubscriptionService
    • CreateSubscription
    • QuerySubscriptions
    • GetSubscription
    • UpdateSubscription
    • DeleteSubscription
  • ▶/TextService
    • SendText
    • QueryTexts
    • GetText
    • CreateAutoReply
    • QueryAutoReplies
    • GetAutoReply
    • DeleteAutoReply
  • ▶/CallService
    • SendCall
    • QueryCalls
    • GetCall
    • CreateSound
    • QuerySoundMeta
    • GetSoundMeta
    • GetSoundData
    • GetRecordingData
    • SendVerificationCodeToCallerId
    • VerifyCallerId
    • GetCallerIds
  • ▶/CccService
    • GetCccCampaign
    • GetCccCampaignStats
    • CreateCccCampaign
    • QueryCccCampaigns
    • UpdateCccCampaign
    • DeleteCccCampaignTransferNumbers
    • DeleteCccCampaignQuestions
    • ControlCccCampaign
    • DeleteCccCampaign
    • GetAgent
    • QueryAgents
    • AddAgents
    • GetAgents
    • RemoveAgent
    • GetAgentGroup
    • QueryAgentGroups
    • CreateAgentGroup
    • UpdateAgentGroup
    • AddAgentGroups
    • GetAgentGroups
    • DeleteAgentGroup
    • RemoveAgentGroup
    • GetAgentSession
    • QueryAgentSessions
    • SendAgentInvites
    • GetAgentInviteUri
  • ▶/ContactService
    • QueryContacts
    • UpdateContacts
    • RemoveContacts
    • GetContact
    • GetContactHistory
    • CreateContactList
    • QueryContactLists
    • DeleteContactList
    • AddContactsToList
    • GetContactList
    • RemoveContactsFromList
    • QueryDncNumbers
    • UpdateDncNumber
    • QueryDncLists
    • CreateDncList
    • GetDncList
    • DeleteDncList
    • AddNumbersToDncList
    • RemoveNumbersFromDncList
  • ▶/NumberService
    • QueryRegions
    • QueryNumbers
    • GetNumber
    • ConfigureNumber
    • SearchAvailableNumbers
    • QueryKeywords
    • SearchAvailableKeywords
    • CreateNumberOrder
    • GetNumberOrder
    • Release
  • ▶/LabelService
    • DeleteLabel
    • QueryLabels
    • LabelBroadcast
    • UnlabelBroadcast
    • LabelNumber
    • UnlabelNumber
  • API    >  
  • SubscriptionService  >  
  • CreateSubscription

CreateSubscription

Creates a new subscription for CallFire event notifications

CreateSubscription registers a URI endpoint to start receiving CallFire notification events on. Returned is the subscriptionId that can be used later to query, update, or delete the subscription. The subscriptionId is also returned as part of all notification events as 'subscriptionId'.

A URI endpoint will need to be provided that can handle the HTTP notification events coming from CallFire.com.

Request Parameters

Parameter Demo Value Description Data Type
CreateSubscription Create 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
NonStrictSsl Enable posting to unknown ssl endpoints (ssl certificate verification will be disabled) boolean
Endpoint Email or URI endpoint to publish notification event to. anyURI
NotificationFormat [XML, JSON, SOAP, EMAIL, LEGACY] 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
ExpiresAt Set when a Subscription will expire long
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

* indicates choice value, bolded parameters are required

Response Parameters

Parameter Description Data Type
CreatedId Unique ID of resource long

 

Example Code

	<?php
/**
 * You'll need your login/password pair when you create the SOAP client.
 * Don't use the fake login/password provided here; it's just for show and won't work.
 */
$wsdl = "http://callfire.com/api/1.1/wsdl/callfire-service-http-soap12.wsdl";
$client = new SoapClient($wsdl, array(
    'soap_version' => SOAP_1_2,
    'login'        => 'YourLoginId',    
    'password'     => 'YourPassword'));


/**
 * CreateSubscription registers a URI endpoint to start receiving
 * CallFire notification events on. This URI endpoint can be either
 * a valid email address or a callback URI endpoint. Returned is the
 * subscriptionId that can be used later to update or delete the 
 * subscription. The subscriptionId is also returned as part of all
 * notification events as 'subscriptionId'.
 * <p>
 * If using callback you will need to provide a URI endpoint that you
 * control to handlethe HTTP notification events coming from CallFire.com.
 */
$request = new stdclass();
$request->Subscription = new stdclass(); // required  
$request->Subscription->Endpoint = 'http://www.yourwebsite.com/somephpfile.php'; // required  
$request->Subscription->NotificationFormat = 'XML'; // required  [XML, JSON, SOAP, EMAIL]
$request->Subscription->TriggerEvent = 'CAMPAIGN_FINISHED';

// CreateSubscription registers a URI endpoint to start receiving
// CallFire notification events on. Returned is the subscriptionId 
// that can be used later to query, update, or delete the subscription. The 
// subscriptionId is also returned as part of all notification events 
// as 'subscriptionId'.
$subscriptionId = $client->CreateSubscription($request);
echo "subscriptionId: $subscriptionId";

// Example output - subscriptionId: 1

// Register an email address for notifications.
$request = new stdclass();
$request->Subscription = new stdclass(); // required
$request->Subscription->Endpoint = 'johndoe@yahoo.com'; // required
$request->Subscription->NotificationFormat = 'EMAIL'; // required  [XML, JSON, SOAP, EMAIL]
$request->Subscription->TriggerEvent = 'CAMPAIGN_FINISHED';

$subscriptionId = $client->CreateSubscription($request);
echo "subscriptionId: $subscriptionId";

// Example output - subscriptionId: 2

?>

Company

  • Careers
  • Blog
  • Press

Products

  • Text Messaging
  • Call Tracking
  • Voice Broadcast
  • CallFire IVR
  • Developer API

Resources

  • Case Studies
  • Industries
  • Communications Glossary
  • Marketing Glossary
  • Area Codes
  • Labs

Help

  • FAQs
  • CallFire XML
  • Contact Us
  • Reviews
  • System Status

© Copyright 2021 CallFire Inc. All Rights Reserved

Privacy Policy / Terms / Service Policy / FTC/FCC/DNC Compliance / Sitemap

Contact Support
Contact Sales
Phone +1.877.897.3473
Fax +1.310.943.0415

Msg&data rates may apply in the US. Standard message and data rates apply in Canada. To unsubscribe from any CallFire ® list simply send 'STOP' to the originating short code or contact Support.