| POST,OPTIONS | /v1/dashboard/finance |
|---|
import java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*
open class FinanceRequest
{
open var FromDate:Date? = null
open var ToDate:Date? = null
open var LocationIds:ArrayList<UUID> = ArrayList<UUID>()
}
open class FinanceResponse
{
open var ResponseStatus:ResponseStatus? = null
open var Stats:ArrayList<DashboardStatTile> = ArrayList<DashboardStatTile>()
open var Trend:ArrayList<DashboardSeries> = ArrayList<DashboardSeries>()
open var SourceMix:DashboardSeries? = null
open var ByLocation:ArrayList<FinanceLocationRow> = ArrayList<FinanceLocationRow>()
open var TopServices:ArrayList<FinanceTopRow> = ArrayList<FinanceTopRow>()
open var TopProducts:ArrayList<FinanceTopRow> = ArrayList<FinanceTopRow>()
open var Subscriptions:FinanceSubscriptionInfo? = null
}
open class DashboardStatTile
{
open var Key:String? = null
open var Label:String? = null
open var Value:Double? = null
open var PreviousValue:Double? = null
open var Unit:String? = null
open var DeltaPct:Double? = null
}
open class DashboardSeries
{
open var Name:String? = null
open var Points:ArrayList<DashboardSeriesPoint> = ArrayList<DashboardSeriesPoint>()
}
open class DashboardSeriesPoint
{
open var Label:String? = null
open var Value:Double? = null
}
open class FinanceLocationRow
{
open var LocationName:String? = null
open var ServiceRev:Double? = null
open var ProductRev:Double? = null
open var SubscriptionRev:Double? = null
open var Total:Double? = null
}
open class FinanceTopRow
{
open var Name:String? = null
open var Revenue:Double? = null
}
open class FinanceSubscriptionInfo
{
open var Mrr:Double? = null
open var Arr:Double? = null
open var ActiveCount:Int? = null
open var NewCount:Int? = null
open var ChurnedCount:Int? = null
open var ChurnRatePct:Double? = null
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/dashboard/finance HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
FromDate: 0001-01-01,
ToDate: 0001-01-01,
LocationIds:
[
00000000000000000000000000000000
]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
},
Stats:
[
{
Key: String,
Label: String,
Value: 0,
PreviousValue: 0,
Unit: String
}
],
Trend:
[
{
Name: String,
Points:
[
{
Label: String,
Value: 0
}
]
}
],
SourceMix:
{
Name: String,
Points:
[
{
Label: String,
Value: 0
}
]
},
ByLocation:
[
{
LocationName: String,
ServiceRev: 0,
ProductRev: 0,
SubscriptionRev: 0,
Total: 0
}
],
TopServices:
[
{
Name: String,
Revenue: 0
}
],
TopProducts:
[
{
Name: String,
Revenue: 0
}
],
Subscriptions:
{
Mrr: 0,
Arr: 0,
ActiveCount: 0,
NewCount: 0,
ChurnedCount: 0,
ChurnRatePct: 0
}
}