| POST | /v4/report/links | ||
|---|---|---|---|
| POST | /v3.5/report/links |
"use strict";
/** @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 PostLinkReportRequest {
/** @param {{reports?:ReportRequest[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {ReportRequest[]} */
reports;
}
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;
}
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;
}
export class PostLinkReportResponse {
/** @param {{responseStatus?:ResponseStatus,reports?:Report[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {ResponseStatus} */
responseStatus;
/** @type {Report[]} */
reports;
}
JavaScript PostLinkReportRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v4/report/links HTTP/1.1
Host: geniuslink-api-zane.dev.platform.georiot.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<PostLinkReportRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/GeniuslinkAPI.ServiceModel.V4.Reporting.Requests">
<reports xmlns:d2p1="http://schemas.datacontract.org/2004/07/GeniuslinkAPI.ServiceModel.V4.Reporting.DTOs" i:nil="true" />
</PostLinkReportRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<PostLinkReportResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/GeniuslinkAPI.ServiceModel.V4.Reporting.Responses">
<reports xmlns:d2p1="http://schemas.datacontract.org/2004/07/GeniuslinkAPI.ServiceModel.V4.Reporting.DTOs" i:nil="true" />
<responseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</responseStatus>
</PostLinkReportResponse>