applyFeature()

subscriptionFeatureId applyFeature(string usn, int featureId,
 date startDate, date endDate)

This method applies a feature to a subscription for the specified length of time. A feature is an item that modifies a subscription and that can be switched on and off, for example, voicemail, call forwarding or DSL shaping.

The method returns a subscriptionFeatureId string that is unique to each call. Use this string to call stopApplyingFeature() and change the date that Smile stops applying the feature to the subscription.

Parameters

usn
Format: string
Purpose: Specifies the USN of the subscription to apply the feature against.
featureId
Format: integer
Purpose: Specifies the ID of the feature to apply. The feature ID is located in the Feature ID field when you view the feature in Smile.
startDate
Format: date
Purpose: Specifies the date at which Smile applies the feature. Smile applies the feature at midnight at the start of the specified day.
If you specify null, Smile immediately applies the feature.
endDate
Format: date
Purpose: Specifies the date at which Smile stops applying the feature. Smile stops applying the feature at midnight at the start of the specified day.
If you specify null, Smile does not set an end date and applies the feature indefinitely.

Results

This method applies the feature at the specified time and returns the subscriptionFeatureId parameter. Smile returns a different value for this parameter each time you call this method.

Smile emits the SubscriptionFeaturesChanged message when Smile applies the feature or stops applying the feature.

Faults

NoSuchItemException

This fault is returned when the specified subscription or feature does not exist.

InvalidRequestException

This fault is returned when the end date is earlier than the start date.

Java client syntax

java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.ApplyFeature usn featureId [startDate] [endDate]
usn
Purpose: Specifies the USN of the subscription for which to apply the feature.
featureId
Purpose: Specifies the ID of the feature to apply.
startDate
Purpose: (Optional) Specifies the date at which Smile applies the feature. If you do not specify this parameter, Smile applies the feature immediately.
endDate
Purpose: (Optional) Specifies the date at which Smile stops applying the feature. If you do not specify this parameter, Smile applies the feature indefinitely.
Note: For more information about the Java client and the options it accepts, see Java client syntax.