Trendsic Platform Service

<back to all web services

StaffResponsesRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/staff/outreach/responses
<?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 StaffResponseDto implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $StaffOutreachRecipientID=0,
        /** @var int */
        public int $ContactID=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Kind=null,
        /** @var float */
        public float $Rate=0.0,
        /** @var float */
        public float $Rating=0.0,
        /** @var int */
        public int $RatingCount=0,
        /** @var string|null */
        public ?string $Status=null,
        /** @var string|null */
        public ?string $Note=null,
        /** @var float */
        public float $CounterRate=0.0,
        /** @var string|null */
        public ?string $CounterStartDate=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['StaffOutreachRecipientID'])) $this->StaffOutreachRecipientID = $o['StaffOutreachRecipientID'];
        if (isset($o['ContactID'])) $this->ContactID = $o['ContactID'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Kind'])) $this->Kind = $o['Kind'];
        if (isset($o['Rate'])) $this->Rate = $o['Rate'];
        if (isset($o['Rating'])) $this->Rating = $o['Rating'];
        if (isset($o['RatingCount'])) $this->RatingCount = $o['RatingCount'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['Note'])) $this->Note = $o['Note'];
        if (isset($o['CounterRate'])) $this->CounterRate = $o['CounterRate'];
        if (isset($o['CounterStartDate'])) $this->CounterStartDate = $o['CounterStartDate'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->StaffOutreachRecipientID)) $o['StaffOutreachRecipientID'] = $this->StaffOutreachRecipientID;
        if (isset($this->ContactID)) $o['ContactID'] = $this->ContactID;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Kind)) $o['Kind'] = $this->Kind;
        if (isset($this->Rate)) $o['Rate'] = $this->Rate;
        if (isset($this->Rating)) $o['Rating'] = $this->Rating;
        if (isset($this->RatingCount)) $o['RatingCount'] = $this->RatingCount;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->Note)) $o['Note'] = $this->Note;
        if (isset($this->CounterRate)) $o['CounterRate'] = $this->CounterRate;
        if (isset($this->CounterStartDate)) $o['CounterStartDate'] = $this->CounterStartDate;
        return empty($o) ? new class(){} : $o;
    }
}

class StaffResponsesResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var array<StaffResponseDto>|null */
        public ?array $Responses=null,
        /** @var int */
        public int $SentCount=0,
        /** @var int */
        public int $OpenedCount=0,
        /** @var int */
        public int $ClickedCount=0,
        /** @var int */
        public int $Accepted=0,
        /** @var int */
        public int $Question=0,
        /** @var int */
        public int $Declined=0,
        /** @var int */
        public int $NoReply=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
        if (isset($o['Responses'])) $this->Responses = JsonConverters::fromArray('StaffResponseDto', $o['Responses']);
        if (isset($o['SentCount'])) $this->SentCount = $o['SentCount'];
        if (isset($o['OpenedCount'])) $this->OpenedCount = $o['OpenedCount'];
        if (isset($o['ClickedCount'])) $this->ClickedCount = $o['ClickedCount'];
        if (isset($o['Accepted'])) $this->Accepted = $o['Accepted'];
        if (isset($o['Question'])) $this->Question = $o['Question'];
        if (isset($o['Declined'])) $this->Declined = $o['Declined'];
        if (isset($o['NoReply'])) $this->NoReply = $o['NoReply'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        if (isset($this->Responses)) $o['Responses'] = JsonConverters::toArray('StaffResponseDto', $this->Responses);
        if (isset($this->SentCount)) $o['SentCount'] = $this->SentCount;
        if (isset($this->OpenedCount)) $o['OpenedCount'] = $this->OpenedCount;
        if (isset($this->ClickedCount)) $o['ClickedCount'] = $this->ClickedCount;
        if (isset($this->Accepted)) $o['Accepted'] = $this->Accepted;
        if (isset($this->Question)) $o['Question'] = $this->Question;
        if (isset($this->Declined)) $o['Declined'] = $this->Declined;
        if (isset($this->NoReply)) $o['NoReply'] = $this->NoReply;
        return empty($o) ? new class(){} : $o;
    }
}

class StaffResponsesRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $PlaceholderContactID=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['PlaceholderContactID'])) $this->PlaceholderContactID = $o['PlaceholderContactID'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->PlaceholderContactID)) $o['PlaceholderContactID'] = $this->PlaceholderContactID;
        return empty($o) ? new class(){} : $o;
    }
}

PHP StaffResponsesRequest DTOs

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

HTTP + XML

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

GET /v1/staff/outreach/responses HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<StaffResponsesResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Accepted>0</Accepted>
  <ClickedCount>0</ClickedCount>
  <Declined>0</Declined>
  <NoReply>0</NoReply>
  <OpenedCount>0</OpenedCount>
  <Question>0</Question>
  <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>
  <Responses>
    <StaffResponseDto>
      <ContactID>0</ContactID>
      <CounterRate>0</CounterRate>
      <CounterStartDate>String</CounterStartDate>
      <Kind>String</Kind>
      <Name>String</Name>
      <Note>String</Note>
      <Rate>0</Rate>
      <Rating>0</Rating>
      <RatingCount>0</RatingCount>
      <StaffOutreachRecipientID>0</StaffOutreachRecipientID>
      <Status>String</Status>
    </StaffResponseDto>
  </Responses>
  <SentCount>0</SentCount>
</StaffResponsesResponse>