Get usage for a plan
This GET
operation requests the subscriber usage for a specific plan. If successful, you receive an HTTP response code of 200
as well as a JSON
response body listing plan usage rules, counters, and general subscriber usage.
See HTTP response codes for other response codes. |
GET /pcc/spcm/subscribers/<msisdn>/plans/<planId>/usage
HEADER INFO
tenant: <tenantName>
authorisation: HTTP Basic Auth
accept: application/vnd.com.tango.pcc.v2+json
permissions: SPCM_PLAN_READ_PERMISSION
URL parameters
There are two mandatory parameters.
Parameter | Type | Description |
---|---|---|
|
string |
The subscriber’s MSISDN in international format. |
|
string |
The unique ID for the plan. |
JSON response
The following example response shows the expected response from passing a recognised msisdn
and planId
in the URL.
To see all possible fields for the plan definitions, see plan definition type descriptions. |
{
{
"plan": {
"planDefinition":
"planDefinition": {
"name": "TEST_1MB_1DAY_FUP",
"identifier": "101",
"unitAmount": "1048576",
"unitMeteringType": "volume",
"cost": 100,
"validityPeriod": "1day",
"classification": "DATA",
"precedence": 2,
"recurring": false,
"core": false,
"summary": "Add-on plan, single-use, 1MB volume, 1 day validity, QoS Downgrade
at 75%",
"maxDeactivationCount": 3,
"recycleRollOverLimit": 0,
"accumulationPermitted": false,
"dpsEnabled": false,
"shared": false,
"activationModeType": "default",
"activationPendingTimeoutPeriod": "",
"validityCarryForward": false,
"validityCarryForwardRankEnabled": false,
"validityCarryForwardRank": 0,
"validityCarryForwardAccumulation": false,
"deferredActivationAllowed": false,
"loanPurchaseAllowed": false,
"recommendationOnPurchase": false,
"version": 1,
"description": "Test plan - 1 day single-use add-on with FUP",
"allowed": false,
"grantedAmount": 555
},
"id": "70314",
"state": "active",
"purchaseTimestamp": "2018-06-12T12:13:44.000+01:00",
"activationTimestamp": "2018-06-12T12:13:44.000+01:00",
"expiryTimestamp": "2018-06-13T00:01:00.000+01:00",
"updateTimestamp": "2018-06-12T12:14:02.000+01:00",
"cancelled": false,
"usage": 790528,
"deactivationCount": 0,
"allowedUnitAmount": "1048576",
"occurrenceCount": 1,
"usageState": "available",
"boosterVolumeCount": 0,
"boosterValidityCount": 0,
"loanAmount": 0
},
"ruleListType": {
"length": 2,
"rule": [
{
"name": "fupRule",
"id": "72892",
"type": "usage",
"state": "violated",
"value": "786432",
"usage": {
"amount": 790528,
"unitMeteringType": "volume"
},
"pccProfile": [
{
"alias": "fup",
"qosProfileName": "QOS_min256_max256",
"serviceProfileName": "Default_SERVICES",
"chargingProfileName": "Prepaid Postpaid Bundle"
}
],
"ruleDefinition": {
"name": "fupRule",
"id": "160",
"summary": "QoS downgrade at 75% of volume limit",
"updateType": "none",
"maxDeactivationPeriod": "",
"threshold": 786432
},
"action": [
{
"messageMethod": "sms",
"name": "Fup_Notification"
}
],
"updateTimestamp": "2018-06-12T12:13:55.000+01:00"
},
{
"name": "Plan Consumption Rule",
"id": "72893",
"type": "usage",
"state": "active",
"value": "1048576",
"usage": {
"amount": 790528,
"unitMeteringType": "volume"
},
"pccProfile": [],
"ruleDefinition": {
"name": "Plan Consumption Rule",
"id": "161",
"updateType": "none",
"threshold": 1048576
},
"action": [
{
"messageMethod": "none",
"name": "Plan Consumed System Action"
}
],
"updateTimestamp": "2018-06-12T12:13:44.000+01:00"
}
]
}
}
Plan type descriptions
Field | Type | Description | ||
---|---|---|---|---|
|
integer |
The plan definition information for the plan.
|
||
|
integer |
Specifies the maximum number of times this plan can recur. options
|
||
|
string |
The unique identifier for the plan. |
||
|
enum |
The current state of the plan in its lifecycle. options
|
||
|
dateTime |
The time at which the plan was purchased.
|
||
|
dateTime |
The time at which the plan was activated.
|
||
|
dateTime |
The time at which the plan will expire.
|
||
|
dateTime |
The time at which the plan was updated.
|
||
|
boolean |
Flag that indicates if the plan has been cancelled. options
|
||
|
long |
The plan’s current usage. The unit type is defined in |
||
|
short |
The number of times the plan has been deactivated. |
||
|
string |
Identifies the source of the plan purchase such as |
||
|
string |
The current allowed plan amount (taken into account rollover, accumulation, and pro-rated data/validity). |
||
|
integer |
The number of times the plan recurred. |
||
|
enum |
The current usage state of the plan. options
|
||
|
dateTime |
The time when the plan was parked for the first time during the current renewal.
|
||
|
dateTime |
The time when the next retry will be made.
|
||
|
short |
The number of times the plan used the volume booster. |
||
|
short |
The number of times the plan used the validity booster. |
Plan definition type descriptions
Field | Type | Description | ||
---|---|---|---|---|
|
integer |
The unique identifier for the plan. This is assigned by the server upon creating a plan definition.
|
||
|
string (255) |
The name of the plan definition.
|
||
|
string (255) |
|||
|
enum |
Defines the unit type. This can be
|
||
|
integer |
The cost or purchasing the plan. Like
|
||
|
string (255) |
A formatted string that displays for how long a plan definition exists. An example is
|
||
|
string |
Denotes the hour, minute, and second at which the plan will expire or renew. NOTE: If not set, the plan will expire or renew relative to the purchase timestamp (timestamp + validity period). This format is |
||
|
integer |
The precedence of the plan over other plans purchased by the subscriber where
|
||
|
boolean |
Denotes whether a plan is recurring or not where
|
||
|
boolean |
Indicates if this plan is the core plan for the subscriber where
|
||
|
string (2048 char) |
A brief summary describing the plan. |
||
|
integer |
The amount of times a plan definition can be deactivated. |
||
|
integer |
The maximum number of times a recurring plan can recur. |
||
|
integer |
The maximum amount of unused data usage that can be carried forward when a plan is renewed.
|
||
|
boolean |
Indicates if accumulation is permitted where
|
||
|
boolean |
Indicates whether DPS is enabled where
|
||
|
boolean |
Indicates if a plan is activated upon purchase where
|
||
|
boolean |
Indicates if a plan is shared where
|
||
|
integer |
Denotes the version of the plan
|
||
|
integer |
Specifies the maximum number of recipients with whom quota can be shared.
|
||
|
integer |
The chunk size that is granted to a data session. The session reports usage after using the granted amount.
|
HTTP response codes
Code | Description | ||||
---|---|---|---|---|---|
|
success! |
||||
|
Multistatus response
|
||||
|
malformed request |
||||
|
unauthorised; bad username or password |
||||
|
forbidden; user does not have appropriate privileges |
||||
|
plan not found |
||||
|
conflict with target resource
|
||||
|
failed validation; this typically means that a property was not set or a value is out of range. example
|
||||
|
failed processing (after passing validation). example
|
||||
|
internal error |
||||
|
request rejected due to overload |