| Requires any of the roles: | Agent, Administrator |
| 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} |
<?php namespace dtos;
use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};
class ReportResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<Object>|null */
public ?array $ReportData=null,
/** @var array<string>|null */
public ?array $Filters=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['ReportData'])) $this->ReportData = JsonConverters::fromArray('Object', $o['ReportData']);
if (isset($o['Filters'])) $this->Filters = JsonConverters::fromArray('string', $o['Filters']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->ReportData)) $o['ReportData'] = JsonConverters::toArray('Object', $this->ReportData);
if (isset($this->Filters)) $o['Filters'] = JsonConverters::toArray('string', $this->Filters);
return empty($o) ? new class(){} : $o;
}
}
class ReportRequest implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $ReportType=null,
/** @var string|null */
public ?string $Argument=null,
/** @var DateTime */
public DateTime $StartDate=new DateTime(),
/** @var DateTime */
public DateTime $EndDate=new DateTime(),
/** @var string|null */
public ?string $Filter=null,
/** @var int */
public int $AgentId=0,
/** @var int */
public int $ReportMonth=0,
/** @var int */
public int $ReportYear=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ReportType'])) $this->ReportType = $o['ReportType'];
if (isset($o['Argument'])) $this->Argument = $o['Argument'];
if (isset($o['StartDate'])) $this->StartDate = JsonConverters::from('DateTime', $o['StartDate']);
if (isset($o['EndDate'])) $this->EndDate = JsonConverters::from('DateTime', $o['EndDate']);
if (isset($o['Filter'])) $this->Filter = $o['Filter'];
if (isset($o['AgentId'])) $this->AgentId = $o['AgentId'];
if (isset($o['ReportMonth'])) $this->ReportMonth = $o['ReportMonth'];
if (isset($o['ReportYear'])) $this->ReportYear = $o['ReportYear'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ReportType)) $o['ReportType'] = $this->ReportType;
if (isset($this->Argument)) $o['Argument'] = $this->Argument;
if (isset($this->StartDate)) $o['StartDate'] = JsonConverters::to('DateTime', $this->StartDate);
if (isset($this->EndDate)) $o['EndDate'] = JsonConverters::to('DateTime', $this->EndDate);
if (isset($this->Filter)) $o['Filter'] = $this->Filter;
if (isset($this->AgentId)) $o['AgentId'] = $this->AgentId;
if (isset($this->ReportMonth)) $o['ReportMonth'] = $this->ReportMonth;
if (isset($this->ReportYear)) $o['ReportYear'] = $this->ReportYear;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=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"]}