| Requires any of the roles: | Agent, Administrator |
| POST,OPTIONS | /v1/report/run |
|---|
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
public static class ReportRunRequest extends ReportDefinition
{
}
public static class ReportDefinition
{
public String DatasetCode = null;
public ArrayList<String> Dimensions = new ArrayList<String>();
public ArrayList<ReportMeasure> Measures = new ArrayList<ReportMeasure>();
public ArrayList<String> Joins = new ArrayList<String>();
public String Filters = null;
public ArrayList<ReportSort> Sorts = new ArrayList<ReportSort>();
public Integer Limit = null;
public String getDatasetCode() { return DatasetCode; }
public ReportDefinition setDatasetCode(String value) { this.DatasetCode = value; return this; }
public ArrayList<String> getDimensions() { return Dimensions; }
public ReportDefinition setDimensions(ArrayList<String> value) { this.Dimensions = value; return this; }
public ArrayList<ReportMeasure> getMeasures() { return Measures; }
public ReportDefinition setMeasures(ArrayList<ReportMeasure> value) { this.Measures = value; return this; }
public ArrayList<String> getJoins() { return Joins; }
public ReportDefinition setJoins(ArrayList<String> value) { this.Joins = value; return this; }
public String getFilters() { return Filters; }
public ReportDefinition setFilters(String value) { this.Filters = value; return this; }
public ArrayList<ReportSort> getSorts() { return Sorts; }
public ReportDefinition setSorts(ArrayList<ReportSort> value) { this.Sorts = value; return this; }
public Integer getLimit() { return Limit; }
public ReportDefinition setLimit(Integer value) { this.Limit = value; return this; }
}
public static class ReportMeasure
{
public String FieldCode = null;
public String Agg = null;
public String getFieldCode() { return FieldCode; }
public ReportMeasure setFieldCode(String value) { this.FieldCode = value; return this; }
public String getAgg() { return Agg; }
public ReportMeasure setAgg(String value) { this.Agg = value; return this; }
}
public static class ReportSort
{
public String FieldCode = null;
public String Dir = null;
public String getFieldCode() { return FieldCode; }
public ReportSort setFieldCode(String value) { this.FieldCode = value; return this; }
public String getDir() { return Dir; }
public ReportSort setDir(String value) { this.Dir = value; return this; }
}
public static class ReportRunResponse
{
public ResponseStatus ResponseStatus = null;
public ReportRunResult Result = null;
public ResponseStatus getResponseStatus() { return ResponseStatus; }
public ReportRunResponse setResponseStatus(ResponseStatus value) { this.ResponseStatus = value; return this; }
public ReportRunResult getResult() { return Result; }
public ReportRunResponse setResult(ReportRunResult value) { this.Result = value; return this; }
}
public static class ReportRunResult
{
public ArrayList<ReportColumnMeta> Columns = new ArrayList<ReportColumnMeta>();
public ArrayList<HashMap<String,Object>> Rows = new ArrayList<HashMap<String,Object>>();
public Integer RowCount = null;
public Boolean Truncated = null;
public ArrayList<String> Notes = new ArrayList<String>();
public ArrayList<ReportColumnMeta> getColumns() { return Columns; }
public ReportRunResult setColumns(ArrayList<ReportColumnMeta> value) { this.Columns = value; return this; }
public ArrayList<HashMap<String,Object>> getRows() { return Rows; }
public ReportRunResult setRows(ArrayList<HashMap<String,Object>> value) { this.Rows = value; return this; }
public Integer getRowCount() { return RowCount; }
public ReportRunResult setRowCount(Integer value) { this.RowCount = value; return this; }
public Boolean isTruncated() { return Truncated; }
public ReportRunResult setTruncated(Boolean value) { this.Truncated = value; return this; }
public ArrayList<String> getNotes() { return Notes; }
public ReportRunResult setNotes(ArrayList<String> value) { this.Notes = value; return this; }
}
public static class ReportColumnMeta
{
public String Code = null;
public String Name = null;
public String DataType = null;
public String FieldKind = null;
public String Agg = null;
public String getCode() { return Code; }
public ReportColumnMeta setCode(String value) { this.Code = value; return this; }
public String getName() { return Name; }
public ReportColumnMeta setName(String value) { this.Name = value; return this; }
public String getDataType() { return DataType; }
public ReportColumnMeta setDataType(String value) { this.DataType = value; return this; }
public String getFieldKind() { return FieldKind; }
public ReportColumnMeta setFieldKind(String value) { this.FieldKind = value; return this; }
public String getAgg() { return Agg; }
public ReportColumnMeta setAgg(String value) { this.Agg = value; return this; }
}
}
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 /v1/report/run HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<ReportRunRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<DatasetCode>String</DatasetCode>
<Dimensions xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</Dimensions>
<Filters>String</Filters>
<Joins xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</Joins>
<Limit>0</Limit>
<Measures>
<ReportMeasure>
<Agg>String</Agg>
<FieldCode>String</FieldCode>
</ReportMeasure>
</Measures>
<Sorts>
<ReportSort>
<Dir>String</Dir>
<FieldCode>String</FieldCode>
</ReportSort>
</Sorts>
</ReportRunRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<ReportRunResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<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>
<Result>
<Columns>
<ReportColumnMeta>
<Agg>String</Agg>
<Code>String</Code>
<DataType>String</DataType>
<FieldKind>String</FieldKind>
<Name>String</Name>
</ReportColumnMeta>
</Columns>
<Notes xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:string>String</d3p1:string>
</Notes>
<RowCount>0</RowCount>
<Rows xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:ArrayOfKeyValueOfstringanyType>
<d3p1:KeyValueOfstringanyType>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value />
</d3p1:KeyValueOfstringanyType>
</d3p1:ArrayOfKeyValueOfstringanyType>
</Rows>
<Truncated>false</Truncated>
</Result>
</ReportRunResponse>