Trendsic Platform Service

<back to all web services

ReportRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
GET,OPTIONS/v1/ReportFilters/{ReportType}
GET,OPTIONS/v1/Report/{ReportType}
GET,OPTIONS/v1/Report/{ReportType}/{Argument}
GET,OPTIONS/v1/Report/{ReportType}/{StartDate}/{EndDate}/{AgentID}
GET,OPTIONS/v1/Report/{ReportType}/{StartDate}/{EndDate}
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class ReportResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    List<dynamic>? ReportData = [];
    List<String>? Filters = [];

    ReportResponse({this.ResponseStatus,this.ReportData,this.Filters});
    ReportResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        ReportData = JsonConverters.fromJson(json['ReportData'],'List<dynamic>',context!);
        Filters = JsonConverters.fromJson(json['Filters'],'List<String>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
        'ReportData': JsonConverters.toJson(ReportData,'List<dynamic>',context!),
        'Filters': JsonConverters.toJson(Filters,'List<String>',context!)
    };

    getTypeName() => "ReportResponse";
    TypeContext? context = _ctx;
}

class ReportRequest implements IConvertible
{
    String? ReportType;
    String? Argument;
    DateTime? StartDate;
    DateTime? EndDate;
    String? Filter;
    int? AgentId;
    int? ReportMonth;
    int? ReportYear;

    ReportRequest({this.ReportType,this.Argument,this.StartDate,this.EndDate,this.Filter,this.AgentId,this.ReportMonth,this.ReportYear});
    ReportRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ReportType = json['ReportType'];
        Argument = json['Argument'];
        StartDate = JsonConverters.fromJson(json['StartDate'],'DateTime',context!);
        EndDate = JsonConverters.fromJson(json['EndDate'],'DateTime',context!);
        Filter = json['Filter'];
        AgentId = json['AgentId'];
        ReportMonth = json['ReportMonth'];
        ReportYear = json['ReportYear'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ReportType': ReportType,
        'Argument': Argument,
        'StartDate': JsonConverters.toJson(StartDate,'DateTime',context!),
        'EndDate': JsonConverters.toJson(EndDate,'DateTime',context!),
        'Filter': Filter,
        'AgentId': AgentId,
        'ReportMonth': ReportMonth,
        'ReportYear': ReportYear
    };

    getTypeName() => "ReportRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'ReportResponse': TypeInfo(TypeOf.Class, create:() => ReportResponse()),
    'List<dynamic>': TypeInfo(TypeOf.Class, create:() => <dynamic>[]),
    'ReportRequest': TypeInfo(TypeOf.Class, create:() => ReportRequest()),
});

Dart ReportRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /v1/ReportFilters/{ReportType} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"ReportData":[{}],"Filters":["String"]}