| POST | /v4/report/links | ||
|---|---|---|---|
| POST | /v3.5/report/links |
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
import com.google.gson.annotations.*;
import com.google.gson.reflect.*;
public class dtos
{
@DataContract
public static class PostLinkReportRequest
{
@DataMember(Name="reports")
@SerializedName("reports")
public ArrayList<ReportRequest> reports = null;
public ArrayList<ReportRequest> getReports() { return reports; }
public PostLinkReportRequest setReports(ArrayList<ReportRequest> value) { this.reports = value; return this; }
}
@DataContract
public static class ReportRequest
{
@DataMember(Name="items")
@SerializedName("items")
public ArrayList<String> items = null;
@DataMember(Name="groupBy")
@SerializedName("groupBy")
public ArrayList<GroupBy> groupBy = null;
@DataMember(Name="attribute")
@SerializedName("attribute")
public String attribute = null;
@DataMember(Name="type")
@SerializedName("type")
public ReportType type = null;
@DataMember(Name="fromStartUtcInclusive")
@SerializedName("fromStartUtcInclusive")
public Date fromStartUtcInclusive = null;
@DataMember(Name="fromEndUtcInclusive")
@SerializedName("fromEndUtcInclusive")
public Date fromEndUtcInclusive = null;
@DataMember(Name="retailers")
@SerializedName("retailers")
public ArrayList<String> retailers = null;
public ArrayList<String> getItems() { return items; }
public ReportRequest setItems(ArrayList<String> value) { this.items = value; return this; }
public ArrayList<GroupBy> getGroupBy() { return groupBy; }
public ReportRequest setGroupBy(ArrayList<GroupBy> value) { this.groupBy = value; return this; }
public String getAttribute() { return attribute; }
public ReportRequest setAttribute(String value) { this.attribute = value; return this; }
public ReportType getType() { return type; }
public ReportRequest setType(ReportType value) { this.type = value; return this; }
public Date getFromStartUtcInclusive() { return fromStartUtcInclusive; }
public ReportRequest setFromStartUtcInclusive(Date value) { this.fromStartUtcInclusive = value; return this; }
public Date getFromEndUtcInclusive() { return fromEndUtcInclusive; }
public ReportRequest setFromEndUtcInclusive(Date value) { this.fromEndUtcInclusive = value; return this; }
public ArrayList<String> getRetailers() { return retailers; }
public ReportRequest setRetailers(ArrayList<String> value) { this.retailers = value; return this; }
}
public static enum GroupBy
{
Default,
Retailer,
Date;
}
public static enum ReportType
{
ShortUrl,
Group,
User;
}
@DataContract
public static class PostLinkReportResponse
{
@DataMember(Name="responseStatus")
@SerializedName("responseStatus")
public ResponseStatus responseStatus = null;
@DataMember(Name="reports")
@SerializedName("reports")
public ArrayList<Report> reports = null;
public ResponseStatus getResponseStatus() { return responseStatus; }
public PostLinkReportResponse setResponseStatus(ResponseStatus value) { this.responseStatus = value; return this; }
public ArrayList<Report> getReports() { return reports; }
public PostLinkReportResponse setReports(ArrayList<Report> value) { this.reports = value; return this; }
}
@DataContract
public static class Report
{
@DataMember(Name="data")
@SerializedName("data")
public ArrayList<ReportData> data = null;
@DataMember(Name="executionTimeMs")
@SerializedName("executionTimeMs")
public Long executionTimeMs = null;
@DataMember(Name="totalItems")
@SerializedName("totalItems")
public Long totalItems = null;
@DataMember(Name="errors")
@SerializedName("errors")
public ArrayList<Error> errors = null;
@DataMember(Name="request")
@SerializedName("request")
public ReportRequest request = null;
@DataMember(Name="totalClicks")
@SerializedName("totalClicks")
public Long totalClicks = null;
public ArrayList<ReportData> getData() { return data; }
public Report setData(ArrayList<ReportData> value) { this.data = value; return this; }
public Long getExecutionTimeMs() { return executionTimeMs; }
public Report setExecutionTimeMs(Long value) { this.executionTimeMs = value; return this; }
public Long getTotalItems() { return totalItems; }
public Report setTotalItems(Long value) { this.totalItems = value; return this; }
public ArrayList<Error> getErrors() { return errors; }
public Report setErrors(ArrayList<Error> value) { this.errors = value; return this; }
public ReportRequest getRequest() { return request; }
public Report setRequest(ReportRequest value) { this.request = value; return this; }
public Long getTotalClicks() { return totalClicks; }
public Report setTotalClicks(Long value) { this.totalClicks = value; return this; }
}
@DataContract
public static class ReportData
{
@DataMember(Name="id")
@SerializedName("id")
public String id = null;
@DataMember(Name="item")
@SerializedName("item")
public Item item = null;
@DataMember(Name="totalClicks")
@SerializedName("totalClicks")
public BigInteger totalClicks = null;
@DataMember(Name="clicks")
@SerializedName("clicks")
public BigInteger actualClicks = null;
@DataMember(Name="junkClicks")
@SerializedName("junkClicks")
public BigInteger junkClicks = null;
@DataMember(Name="spiderClicks")
@SerializedName("spiderClicks")
public BigInteger spiderClicks = null;
@DataMember(Name="dateUtc")
@SerializedName("dateUtc")
public Date dateUtc = null;
public String getId() { return id; }
public ReportData setId(String value) { this.id = value; return this; }
public Item getItem() { return item; }
public ReportData setItem(Item value) { this.item = value; return this; }
public BigInteger getTotalClicks() { return totalClicks; }
public ReportData setTotalClicks(BigInteger value) { this.totalClicks = value; return this; }
public BigInteger getActualClicks() { return actualClicks; }
public ReportData setActualClicks(BigInteger value) { this.actualClicks = value; return this; }
public BigInteger getJunkClicks() { return junkClicks; }
public ReportData setJunkClicks(BigInteger value) { this.junkClicks = value; return this; }
public BigInteger getSpiderClicks() { return spiderClicks; }
public ReportData setSpiderClicks(BigInteger value) { this.spiderClicks = value; return this; }
public Date getDateUtc() { return dateUtc; }
public ReportData setDateUtc(Date value) { this.dateUtc = value; return this; }
}
@DataContract
public static class Item
{
@DataMember(Name="id")
@SerializedName("id")
public String id = null;
@DataMember(Name="displayName")
@SerializedName("displayName")
public String displayName = null;
public String getId() { return id; }
public Item setId(String value) { this.id = value; return this; }
public String getDisplayName() { return displayName; }
public Item setDisplayName(String value) { this.displayName = value; return this; }
}
@DataContract
public static class Error
{
@DataMember(Name="code")
@SerializedName("code")
public String code = null;
public String getCode() { return code; }
public Error setCode(String value) { this.code = value; return this; }
}
}
Java PostLinkReportRequest 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.
POST /v4/report/links HTTP/1.1
Host: geniuslink-api-zane.dev.platform.georiot.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}