getSubscriptionSpendLimitState()
SubscriptionSpendLimit getSubscriptionSpendLimitState(string usn, string spendLimitId)
This method returns information about the current state of a specified spend limit. Use this method to retrieve and display information about a specific spend limit for a subscription.
Parameters
- usn
- Format: string
- spendLimitId
- Format: string
Results
This method returns a SubscriptionSpendLimit XML document that lists information about the current state of the spend limit, for example, the spend limit value, amount spent in the period to date, alert thresholds and reset date.
There are no messages defined by this method.
Example: A returned SubscriptionSpendLimit XML document
This example shows a SubscriptionSpendLimit XML document for the SMS spend limit. The subscription has exceeded the spend limit of $50.
<SubscriptionSpendLimit xmlns="http://xml.inomial.com/smile/2.xsd">
<SpendLimit>
<spendLimitId>7</spendLimitId>
<sid>137</sid>
<name>SMS</name>
<limit>50</limit>
<alertThresholds>
<alertThreshold>50</alertThreshold>
<alertThreshold>80</alertThreshold>
<alertThreshold>100</alertThreshold>
</alertThresholds>
</SpendLimit>
<periodEnd>2012-08-31+10:00</periodEnd>
<effectiveLimit>50</effectiveLimit>
<effectiveAlertThresholds>
<alertThreshold>50</alertThreshold>
<alertThreshold>80</alertThreshold>
<alertThreshold>100</alertThreshold>
</effectiveAlertThresholds>
<currentSpend>56.178000</currentSpend>
<currentThreshold>100</currentThreshold>
<previousThreshold>50</previousThreshold>
</SubscriptionSpendLimit>
Faults
NoSuchItemExceptionThis fault is returned when the subscription or spend limit does not exist.
InvalidRequestExceptionThis fault is returned when the spend limit is not associated with the subscription.
Java client syntax
java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.GetSubscriptionSpendLimitState usn spendLimitId
- usn
- Purpose: Specifies the USN of the subscription associated with the spend limit.
- spendLimitId
- Purpose: Specifies the ID of the spend limit for which to retrieve information.