get https://secure.fusebill.com/v1/customers//subscriptions/GetCountByStatus?status=
This request returns the number of subscriptions belonging to a particular customer with a particular status.
Path Parameters
Property | Type | Description |
---|---|---|
customerId | Integer | The Fusebill generated ID that uniquely identifies the customer entity |
URL Parameters
Property | Type | Description | Required |
---|---|---|---|
status | Enum: {Active, Draft, Cancelled, Provisioning, Expired, Suspended, Migrated, StandingOrder} | The status to be used for counting | Yes |
Examples
curl –X GET https://secure.fusebill.com/v1/customers/{customerId}/subscriptions/GetCountByStatus?status={status} \
-H "Content-Type: application/json" \
-H "Authorization: Basic {APIKey}"
//Setup customer ID and status
Int customerId = {customerId};
string status = {status};
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/customers/" + customerId + "/subscriptions/GetCountByStatus?status=" + status);
//Add Content type
request.ContentType = "application/json";
//Add Api key authorization
request.Headers.Add(HttpRequestHeader.Authorization, "Basic "+apiKey);
//Set request method
request.Method = "GET";
//Perform the request
var httpResponse = (HttpWebResponse)request.GetResponse();
//Record the response from our request
var result = "";
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
result = streamReader.ReadToEnd();
}
#Import library JSON
import json
#Import library Requests
import requests
#Pass in a dictionary to the Headers parameter
headers = {'Authorization' : 'Basic {APIKey}', 'Content-Type' : 'application/json'}
#Pass in your URI and Headers
r = requests.get('https://secure.fusebill.com/v1/customers/{customerId}/subscriptions/GetCountByStatus?status={status}', headers=headers)
print(r.content)
Response
4
{
"ErrorId": 0,
"HttpStatusCode": 500,
"Errors": [
{
"Key": "Api Error",
"Value": "Requested value 'Actidve' was not found."
}
]
}