| GET | /v1/links/report |
|---|
"use strict";
export class Item {
/** @param {{id?:string,displayName?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
id;
/** @type {string} */
displayName;
}
export class ReportData {
/** @param {{id?:string,item?:Item,totalClicks?:number,clicks?:number,junkClicks?:number,spiderClicks?:number,dateUtc?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
id;
/** @type {Item} */
item;
/** @type {number} */
totalClicks;
/** @type {number} */
clicks;
/** @type {number} */
junkClicks;
/** @type {number} */
spiderClicks;
/** @type {string} */
dateUtc;
}
export class Error {
/** @param {{code?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
code;
}
/** @typedef {'Default'|'Retailer'|'Date'} */
export var GroupBy;
(function (GroupBy) {
GroupBy["Default"] = "Default"
GroupBy["Retailer"] = "Retailer"
GroupBy["Date"] = "Date"
})(GroupBy || (GroupBy = {}));
/** @typedef {'ShortUrl'|'Group'|'User'} */
export var ReportType;
(function (ReportType) {
ReportType["ShortUrl"] = "ShortUrl"
ReportType["Group"] = "Group"
ReportType["User"] = "User"
})(ReportType || (ReportType = {}));
export class ReportRequest {
/** @param {{items?:string[],groupBy?:GroupBy[],attribute?:string,type?:ReportType,fromStartUtcInclusive?:string,fromEndUtcInclusive?:string,retailers?:string[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string[]} */
items;
/** @type {GroupBy[]} */
groupBy;
/** @type {string} */
attribute;
/** @type {ReportType} */
type;
/** @type {string} */
fromStartUtcInclusive;
/** @type {string} */
fromEndUtcInclusive;
/** @type {string[]} */
retailers;
}
export class Report extends Report {
/** @param {{data?:ReportData[],executionTimeMs?:number,totalItems?:number,errors?:Error[],request?:ReportRequest,totalClicks?:number}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
}
export class ClickReport {
/** @param {{code?:string,reports?:{ [index:string]: Report; },totalClicks?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
code;
/** @type {{ [index:string]: Report; }} */
reports;
/** @type {number} */
totalClicks;
}
export class GetLinkReportResponse {
/** @param {{reports?:ClickReport,responseStatus?:ResponseStatus}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {ClickReport} */
reports;
/** @type {ResponseStatus} */
responseStatus;
}
export class GetLinkReportRequest {
/** @param {{baseCode?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
baseCode;
}
export class Report {
/** @param {{data?:ReportData[],executionTimeMs?:number,totalItems?:number,errors?:Error[],request?:ReportRequest,totalClicks?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {ReportData[]} */
data;
/** @type {number} */
executionTimeMs;
/** @type {number} */
totalItems;
/** @type {Error[]} */
errors;
/** @type {ReportRequest} */
request;
/** @type {number} */
totalClicks;
}
JavaScript GetLinkReportRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
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/csv
HTTP/1.1 200 OK
Content-Type: text/csv
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-01T00:00:00.0000000"}],"executionTimeMs":0,"totalItems":1,"errors":[{}],"request":{"attribute":"String","type":"ShortUrl","fromStartUtcInclusive":"0001-01-01T00:00:00.0000000","fromEndUtcInclusive":"0001-01-01T00:00:00.0000000"},"totalClicks":0}},"totalClicks":0},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}