| Requires any of the roles: | Worker, Agent, Administrator |
| GET,OPTIONS | /v1/contact/{ContactId}/visits |
|---|
<?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 ContactQueueVisit implements JsonSerializable
{
public function __construct(
/** @var string */
public string $CheckinId='',
/** @var string */
public string $BranchId='',
/** @var string|null */
public ?string $BranchName=null,
/** @var string */
public string $LineId='',
/** @var string|null */
public ?string $ServiceName=null,
/** @var int */
public int $Outcome=0,
/** @var string|null */
public ?string $OutcomeLabel=null,
/** @var bool|null */
public ?bool $IsAppointment=null,
/** @var DateTime|null */
public ?DateTime $SignInUtc=null,
/** @var DateTime|null */
public ?DateTime $CalledUtc=null,
/** @var DateTime|null */
public ?DateTime $FirstStartUtc=null,
/** @var DateTime|null */
public ?DateTime $CompletedTime=null,
/** @var int|null */
public ?int $WaitMinutes=null,
/** @var int|null */
public ?int $ServiceMinutes=null,
/** @var string|null */
public ?string $WindowName=null,
/** @var string|null */
public ?string $TicketLabel=null,
/** @var string|null */
public ?string $HoldReason=null,
/** @var DateTime|null */
public ?DateTime $ReturnedTime=null,
/** @var int */
public int $PausedMinutes=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CheckinId'])) $this->CheckinId = $o['CheckinId'];
if (isset($o['BranchId'])) $this->BranchId = $o['BranchId'];
if (isset($o['BranchName'])) $this->BranchName = $o['BranchName'];
if (isset($o['LineId'])) $this->LineId = $o['LineId'];
if (isset($o['ServiceName'])) $this->ServiceName = $o['ServiceName'];
if (isset($o['Outcome'])) $this->Outcome = $o['Outcome'];
if (isset($o['OutcomeLabel'])) $this->OutcomeLabel = $o['OutcomeLabel'];
if (isset($o['IsAppointment'])) $this->IsAppointment = $o['IsAppointment'];
if (isset($o['SignInUtc'])) $this->SignInUtc = JsonConverters::from('DateTime', $o['SignInUtc']);
if (isset($o['CalledUtc'])) $this->CalledUtc = JsonConverters::from('DateTime', $o['CalledUtc']);
if (isset($o['FirstStartUtc'])) $this->FirstStartUtc = JsonConverters::from('DateTime', $o['FirstStartUtc']);
if (isset($o['CompletedTime'])) $this->CompletedTime = JsonConverters::from('DateTime', $o['CompletedTime']);
if (isset($o['WaitMinutes'])) $this->WaitMinutes = $o['WaitMinutes'];
if (isset($o['ServiceMinutes'])) $this->ServiceMinutes = $o['ServiceMinutes'];
if (isset($o['WindowName'])) $this->WindowName = $o['WindowName'];
if (isset($o['TicketLabel'])) $this->TicketLabel = $o['TicketLabel'];
if (isset($o['HoldReason'])) $this->HoldReason = $o['HoldReason'];
if (isset($o['ReturnedTime'])) $this->ReturnedTime = JsonConverters::from('DateTime', $o['ReturnedTime']);
if (isset($o['PausedMinutes'])) $this->PausedMinutes = $o['PausedMinutes'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CheckinId)) $o['CheckinId'] = $this->CheckinId;
if (isset($this->BranchId)) $o['BranchId'] = $this->BranchId;
if (isset($this->BranchName)) $o['BranchName'] = $this->BranchName;
if (isset($this->LineId)) $o['LineId'] = $this->LineId;
if (isset($this->ServiceName)) $o['ServiceName'] = $this->ServiceName;
if (isset($this->Outcome)) $o['Outcome'] = $this->Outcome;
if (isset($this->OutcomeLabel)) $o['OutcomeLabel'] = $this->OutcomeLabel;
if (isset($this->IsAppointment)) $o['IsAppointment'] = $this->IsAppointment;
if (isset($this->SignInUtc)) $o['SignInUtc'] = JsonConverters::to('DateTime', $this->SignInUtc);
if (isset($this->CalledUtc)) $o['CalledUtc'] = JsonConverters::to('DateTime', $this->CalledUtc);
if (isset($this->FirstStartUtc)) $o['FirstStartUtc'] = JsonConverters::to('DateTime', $this->FirstStartUtc);
if (isset($this->CompletedTime)) $o['CompletedTime'] = JsonConverters::to('DateTime', $this->CompletedTime);
if (isset($this->WaitMinutes)) $o['WaitMinutes'] = $this->WaitMinutes;
if (isset($this->ServiceMinutes)) $o['ServiceMinutes'] = $this->ServiceMinutes;
if (isset($this->WindowName)) $o['WindowName'] = $this->WindowName;
if (isset($this->TicketLabel)) $o['TicketLabel'] = $this->TicketLabel;
if (isset($this->HoldReason)) $o['HoldReason'] = $this->HoldReason;
if (isset($this->ReturnedTime)) $o['ReturnedTime'] = JsonConverters::to('DateTime', $this->ReturnedTime);
if (isset($this->PausedMinutes)) $o['PausedMinutes'] = $this->PausedMinutes;
return empty($o) ? new class(){} : $o;
}
}
class ContactQueueVisitSummary implements JsonSerializable
{
public function __construct(
/** @var int */
public int $Visits=0,
/** @var int */
public int $Completed=0,
/** @var int */
public int $NoShows=0,
/** @var int */
public int $NoShows90d=0,
/** @var int */
public int $Cancelled=0,
/** @var int */
public int $Unfulfilled=0,
/** @var int */
public int $Appointments=0,
/** @var DateTime|null */
public ?DateTime $LastVisitUtc=null,
/** @var DateTime|null */
public ?DateTime $LastNoShowUtc=null,
/** @var float|null */
public ?float $AvgWaitMinutes=null,
/** @var bool|null */
public ?bool $SmsOptIn=null,
/** @var int */
public int $TextsSent90d=0,
/** @var string|null */
public ?string $SayNameAs=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Visits'])) $this->Visits = $o['Visits'];
if (isset($o['Completed'])) $this->Completed = $o['Completed'];
if (isset($o['NoShows'])) $this->NoShows = $o['NoShows'];
if (isset($o['NoShows90d'])) $this->NoShows90d = $o['NoShows90d'];
if (isset($o['Cancelled'])) $this->Cancelled = $o['Cancelled'];
if (isset($o['Unfulfilled'])) $this->Unfulfilled = $o['Unfulfilled'];
if (isset($o['Appointments'])) $this->Appointments = $o['Appointments'];
if (isset($o['LastVisitUtc'])) $this->LastVisitUtc = JsonConverters::from('DateTime', $o['LastVisitUtc']);
if (isset($o['LastNoShowUtc'])) $this->LastNoShowUtc = JsonConverters::from('DateTime', $o['LastNoShowUtc']);
if (isset($o['AvgWaitMinutes'])) $this->AvgWaitMinutes = $o['AvgWaitMinutes'];
if (isset($o['SmsOptIn'])) $this->SmsOptIn = $o['SmsOptIn'];
if (isset($o['TextsSent90d'])) $this->TextsSent90d = $o['TextsSent90d'];
if (isset($o['SayNameAs'])) $this->SayNameAs = $o['SayNameAs'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Visits)) $o['Visits'] = $this->Visits;
if (isset($this->Completed)) $o['Completed'] = $this->Completed;
if (isset($this->NoShows)) $o['NoShows'] = $this->NoShows;
if (isset($this->NoShows90d)) $o['NoShows90d'] = $this->NoShows90d;
if (isset($this->Cancelled)) $o['Cancelled'] = $this->Cancelled;
if (isset($this->Unfulfilled)) $o['Unfulfilled'] = $this->Unfulfilled;
if (isset($this->Appointments)) $o['Appointments'] = $this->Appointments;
if (isset($this->LastVisitUtc)) $o['LastVisitUtc'] = JsonConverters::to('DateTime', $this->LastVisitUtc);
if (isset($this->LastNoShowUtc)) $o['LastNoShowUtc'] = JsonConverters::to('DateTime', $this->LastNoShowUtc);
if (isset($this->AvgWaitMinutes)) $o['AvgWaitMinutes'] = $this->AvgWaitMinutes;
if (isset($this->SmsOptIn)) $o['SmsOptIn'] = $this->SmsOptIn;
if (isset($this->TextsSent90d)) $o['TextsSent90d'] = $this->TextsSent90d;
if (isset($this->SayNameAs)) $o['SayNameAs'] = $this->SayNameAs;
return empty($o) ? new class(){} : $o;
}
}
class ContactVisitsResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<ContactQueueVisit>|null */
public ?array $Visits=null,
/** @var ContactQueueVisitSummary|null */
public ?ContactQueueVisitSummary $Summary=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['Visits'])) $this->Visits = JsonConverters::fromArray('ContactQueueVisit', $o['Visits']);
if (isset($o['Summary'])) $this->Summary = JsonConverters::from('ContactQueueVisitSummary', $o['Summary']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->Visits)) $o['Visits'] = JsonConverters::toArray('ContactQueueVisit', $this->Visits);
if (isset($this->Summary)) $o['Summary'] = JsonConverters::to('ContactQueueVisitSummary', $this->Summary);
return empty($o) ? new class(){} : $o;
}
}
class ContactVisitsRequest implements JsonSerializable
{
public function __construct(
/** @var int */
public int $ContactId=0,
/** @var int */
public int $Take=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ContactId'])) $this->ContactId = $o['ContactId'];
if (isset($o['Take'])) $this->Take = $o['Take'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ContactId)) $o['ContactId'] = $this->ContactId;
if (isset($this->Take)) $o['Take'] = $this->Take;
return empty($o) ? new class(){} : $o;
}
}
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.
GET /v1/contact/{ContactId}/visits HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<ContactVisitsResponse 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>
<Summary>
<Appointments>0</Appointments>
<AvgWaitMinutes>0</AvgWaitMinutes>
<Cancelled>0</Cancelled>
<Completed>0</Completed>
<LastNoShowUtc>0001-01-01T00:00:00</LastNoShowUtc>
<LastVisitUtc>0001-01-01T00:00:00</LastVisitUtc>
<NoShows>0</NoShows>
<NoShows90d>0</NoShows90d>
<SayNameAs>String</SayNameAs>
<SmsOptIn>false</SmsOptIn>
<TextsSent90d>0</TextsSent90d>
<Unfulfilled>0</Unfulfilled>
<Visits>0</Visits>
</Summary>
<Visits>
<ContactQueueVisit>
<BranchId>00000000-0000-0000-0000-000000000000</BranchId>
<BranchName>String</BranchName>
<CalledUtc>0001-01-01T00:00:00</CalledUtc>
<CheckinId>00000000-0000-0000-0000-000000000000</CheckinId>
<CompletedTime>0001-01-01T00:00:00</CompletedTime>
<FirstStartUtc>0001-01-01T00:00:00</FirstStartUtc>
<HoldReason>String</HoldReason>
<IsAppointment>false</IsAppointment>
<LineId>00000000-0000-0000-0000-000000000000</LineId>
<Outcome>0</Outcome>
<OutcomeLabel>String</OutcomeLabel>
<PausedMinutes>0</PausedMinutes>
<ReturnedTime>0001-01-01T00:00:00</ReturnedTime>
<ServiceMinutes>0</ServiceMinutes>
<ServiceName>String</ServiceName>
<SignInUtc>0001-01-01T00:00:00</SignInUtc>
<TicketLabel>String</TicketLabel>
<WaitMinutes>0</WaitMinutes>
<WindowName>String</WindowName>
</ContactQueueVisit>
</Visits>
</ContactVisitsResponse>