| GET | /v1/links/report |
|---|
import java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*
import com.google.gson.annotations.*
import com.google.gson.reflect.*
@DataContract
open class GetLinkReportRequest
{
@DataMember(Name="baseCode")
@SerializedName("baseCode")
open var baseCode:String? = null
}
@DataContract
open class GetLinkReportResponse
{
@DataMember(Name="reports")
@SerializedName("reports")
open var report:ClickReport? = null
@DataMember(Name="responseStatus")
@SerializedName("responseStatus")
open var responseStatus:ResponseStatus? = null
}
@DataContract
open class ClickReport
{
@DataMember(Name="code")
@SerializedName("code")
open var code:String? = null
@DataMember(Name="reports")
@SerializedName("reports")
open var reports:HashMap<String,Report>? = null
@DataMember(Name="totalClicks")
@SerializedName("totalClicks")
open var totalClicks:BigInteger? = null
}
@DataContract
open class Report : Report()
{
}
@DataContract
open class Report
{
@DataMember(Name="data")
@SerializedName("data")
open var Data:ArrayList<ReportData>? = null
@DataMember(Name="executionTimeMs")
@SerializedName("executionTimeMs")
open var executionTimeMs:Long? = null
@DataMember(Name="totalItems")
@SerializedName("totalItems")
open var totalItems:Long? = null
@DataMember(Name="errors")
@SerializedName("errors")
open var errors:ArrayList<Error>? = null
@DataMember(Name="request")
@SerializedName("request")
open var request:ReportRequest? = null
@DataMember(Name="totalClicks")
@SerializedName("totalClicks")
open var totalClicks:Long? = null
}
@DataContract
open class ReportData
{
@DataMember(Name="id")
@SerializedName("id")
open var id:String? = null
@DataMember(Name="item")
@SerializedName("item")
open var item:Item? = null
@DataMember(Name="totalClicks")
@SerializedName("totalClicks")
open var totalClicks:BigInteger? = null
@DataMember(Name="clicks")
@SerializedName("clicks")
open var actualClicks:BigInteger? = null
@DataMember(Name="junkClicks")
@SerializedName("junkClicks")
open var junkClicks:BigInteger? = null
@DataMember(Name="spiderClicks")
@SerializedName("spiderClicks")
open var spiderClicks:BigInteger? = null
@DataMember(Name="dateUtc")
@SerializedName("dateUtc")
open var dateUtc:Date? = null
}
@DataContract
open class Item
{
@DataMember(Name="id")
@SerializedName("id")
open var id:String? = null
@DataMember(Name="displayName")
@SerializedName("displayName")
open var displayName:String? = null
}
@DataContract
open class Error
{
@DataMember(Name="code")
@SerializedName("code")
open var code:String? = null
}
@DataContract
open class ReportRequest
{
@DataMember(Name="items")
@SerializedName("items")
open var items:ArrayList<String>? = null
@DataMember(Name="groupBy")
@SerializedName("groupBy")
open var groupBy:ArrayList<GroupBy>? = null
@DataMember(Name="attribute")
@SerializedName("attribute")
open var attribute:String? = null
@DataMember(Name="type")
@SerializedName("type")
open var Type:ReportType? = null
@DataMember(Name="fromStartUtcInclusive")
@SerializedName("fromStartUtcInclusive")
open var fromStartUtcInclusive:Date? = null
@DataMember(Name="fromEndUtcInclusive")
@SerializedName("fromEndUtcInclusive")
open var fromEndUtcInclusive:Date? = null
@DataMember(Name="retailers")
@SerializedName("retailers")
open var retailers:ArrayList<String>? = null
}
enum class GroupBy
{
Default,
Retailer,
Date,
}
enum class ReportType
{
ShortUrl,
Group,
User,
}
Kotlin GetLinkReportRequest DTOs
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.
GET /v1/links/report HTTP/1.1 Host: api.booklinker.com Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
reports:
{
code: String,
reports:
{
String:
{
data:
[
{
id: String,
item:
{
id: String,
displayName: String
},
totalClicks: 0,
clicks: 0,
junkClicks: 0,
spiderClicks: 0,
dateUtc: 0001-01-01
}
],
executionTimeMs: 0,
totalItems: 1,
errors:
[
{
}
],
request:
{
attribute: String,
type: ShortUrl,
fromStartUtcInclusive: 0001-01-01,
fromEndUtcInclusive: 0001-01-01
},
totalClicks: 0
}
},
totalClicks: 0
},
responseStatus:
{
errorCode: String,
message: String,
stackTrace: String,
errors:
[
{
errorCode: String,
fieldName: String,
message: String,
meta:
{
String: String
}
}
],
meta:
{
String: String
}
}
}