Trendsic Platform Service

<back to all web services

ReminderRequest

Requires Authentication
Requires any of the roles:Agent, Administrator, Agent, Administrator, Agent, Administrator, Agent, Administrator
The following routes are available for this service:
GET,DELETE,OPTIONS/v1/Reminder/{ReminderId}
POST,PUT,OPTIONS/v1/Reminder
<?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 Reminder implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $ReminderId='',
        /** @var string|null */
        public ?string $TableName=null,
        /** @var string|null */
        public ?string $FieldName=null,
        /** @var int */
        public int $RecordId=0,
        /** @var DateTime */
        public DateTime $ReminderDate=new DateTime(),
        /** @var string|null */
        public ?string $ReminderNote=null,
        /** @var DateTime */
        public DateTime $CreatedDate=new DateTime(),
        /** @var string|null */
        public ?string $CreatedBy=null,
        /** @var DateTime */
        public DateTime $CompletedDate=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ReminderId'])) $this->ReminderId = $o['ReminderId'];
        if (isset($o['TableName'])) $this->TableName = $o['TableName'];
        if (isset($o['FieldName'])) $this->FieldName = $o['FieldName'];
        if (isset($o['RecordId'])) $this->RecordId = $o['RecordId'];
        if (isset($o['ReminderDate'])) $this->ReminderDate = JsonConverters::from('DateTime', $o['ReminderDate']);
        if (isset($o['ReminderNote'])) $this->ReminderNote = $o['ReminderNote'];
        if (isset($o['CreatedDate'])) $this->CreatedDate = JsonConverters::from('DateTime', $o['CreatedDate']);
        if (isset($o['CreatedBy'])) $this->CreatedBy = $o['CreatedBy'];
        if (isset($o['CompletedDate'])) $this->CompletedDate = JsonConverters::from('DateTime', $o['CompletedDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ReminderId)) $o['ReminderId'] = $this->ReminderId;
        if (isset($this->TableName)) $o['TableName'] = $this->TableName;
        if (isset($this->FieldName)) $o['FieldName'] = $this->FieldName;
        if (isset($this->RecordId)) $o['RecordId'] = $this->RecordId;
        if (isset($this->ReminderDate)) $o['ReminderDate'] = JsonConverters::to('DateTime', $this->ReminderDate);
        if (isset($this->ReminderNote)) $o['ReminderNote'] = $this->ReminderNote;
        if (isset($this->CreatedDate)) $o['CreatedDate'] = JsonConverters::to('DateTime', $this->CreatedDate);
        if (isset($this->CreatedBy)) $o['CreatedBy'] = $this->CreatedBy;
        if (isset($this->CompletedDate)) $o['CompletedDate'] = JsonConverters::to('DateTime', $this->CompletedDate);
        return empty($o) ? new class(){} : $o;
    }
}

class ReminderExtended extends Reminder implements JsonSerializable
{
    /**
     * @param string $ReminderId
     * @param string|null $TableName
     * @param string|null $FieldName
     * @param int $RecordId
     * @param DateTime $ReminderDate
     * @param string|null $ReminderNote
     * @param DateTime $CreatedDate
     * @param string|null $CreatedBy
     * @param DateTime $CompletedDate
     */
    public function __construct(
        string $ReminderId='',
        ?string $TableName=null,
        ?string $FieldName=null,
        int $RecordId=0,
        DateTime $ReminderDate=new DateTime(),
        ?string $ReminderNote=null,
        DateTime $CreatedDate=new DateTime(),
        ?string $CreatedBy=null,
        DateTime $CompletedDate=new DateTime(),
        /** @var string|null */
        public ?string $AgentName=null,
        /** @var string|null */
        public ?string $RecordAgentName=null,
        /** @var int */
        public int $RecordAgentID=0,
        /** @var bool|null */
        public ?bool $IsAdmin=null,
        /** @var int */
        public int $AgentID=0
    ) {
        parent::__construct($ReminderId,$TableName,$FieldName,$RecordId,$ReminderDate,$ReminderNote,$CreatedDate,$CreatedBy,$CompletedDate);
    }

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

class ReminderResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var array<ReminderExtended>|null */
        public ?array $Reminder=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
        if (isset($o['Reminder'])) $this->Reminder = JsonConverters::fromArray('ReminderExtended', $o['Reminder']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        if (isset($this->Reminder)) $o['Reminder'] = JsonConverters::toArray('ReminderExtended', $this->Reminder);
        return empty($o) ? new class(){} : $o;
    }
}

class ReminderRequest implements JsonSerializable
{
    public function __construct(
        /** @var array<ReminderExtended>|null */
        public ?array $Reminder=null,
        /** @var string */
        public string $ReminderId='',
        /** @var bool|null */
        public ?bool $RemindOwner=null,
        /** @var string|null */
        public ?string $AgentName=null,
        /** @var bool|null */
        public ?bool $CCAVP=null,
        /** @var bool|null */
        public ?bool $IsAdminReminder=null,
        /** @var int */
        public int $AdminAgentId=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Reminder'])) $this->Reminder = JsonConverters::fromArray('ReminderExtended', $o['Reminder']);
        if (isset($o['ReminderId'])) $this->ReminderId = $o['ReminderId'];
        if (isset($o['RemindOwner'])) $this->RemindOwner = $o['RemindOwner'];
        if (isset($o['AgentName'])) $this->AgentName = $o['AgentName'];
        if (isset($o['CCAVP'])) $this->CCAVP = $o['CCAVP'];
        if (isset($o['IsAdminReminder'])) $this->IsAdminReminder = $o['IsAdminReminder'];
        if (isset($o['AdminAgentId'])) $this->AdminAgentId = $o['AdminAgentId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Reminder)) $o['Reminder'] = JsonConverters::toArray('ReminderExtended', $this->Reminder);
        if (isset($this->ReminderId)) $o['ReminderId'] = $this->ReminderId;
        if (isset($this->RemindOwner)) $o['RemindOwner'] = $this->RemindOwner;
        if (isset($this->AgentName)) $o['AgentName'] = $this->AgentName;
        if (isset($this->CCAVP)) $o['CCAVP'] = $this->CCAVP;
        if (isset($this->IsAdminReminder)) $o['IsAdminReminder'] = $this->IsAdminReminder;
        if (isset($this->AdminAgentId)) $o['AdminAgentId'] = $this->AdminAgentId;
        return empty($o) ? new class(){} : $o;
    }
}

PHP ReminderRequest 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.

POST /v1/Reminder HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<ReminderRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <AdminAgentId>0</AdminAgentId>
  <AgentName>String</AgentName>
  <CCAVP>false</CCAVP>
  <IsAdminReminder>false</IsAdminReminder>
  <RemindOwner>false</RemindOwner>
  <Reminder>
    <ReminderExtended>
      <CompletedDate>0001-01-01T00:00:00</CompletedDate>
      <CreatedBy>String</CreatedBy>
      <CreatedDate>0001-01-01T00:00:00</CreatedDate>
      <FieldName>String</FieldName>
      <RecordId>0</RecordId>
      <ReminderDate>0001-01-01T00:00:00</ReminderDate>
      <ReminderId>00000000-0000-0000-0000-000000000000</ReminderId>
      <ReminderNote>String</ReminderNote>
      <TableName>String</TableName>
      <AgentID>0</AgentID>
      <AgentName>String</AgentName>
      <IsAdmin>false</IsAdmin>
      <RecordAgentID>0</RecordAgentID>
      <RecordAgentName>String</RecordAgentName>
    </ReminderExtended>
  </Reminder>
  <ReminderId>00000000-0000-0000-0000-000000000000</ReminderId>
</ReminderRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ReminderResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Reminder>
    <ReminderExtended>
      <CompletedDate>0001-01-01T00:00:00</CompletedDate>
      <CreatedBy>String</CreatedBy>
      <CreatedDate>0001-01-01T00:00:00</CreatedDate>
      <FieldName>String</FieldName>
      <RecordId>0</RecordId>
      <ReminderDate>0001-01-01T00:00:00</ReminderDate>
      <ReminderId>00000000-0000-0000-0000-000000000000</ReminderId>
      <ReminderNote>String</ReminderNote>
      <TableName>String</TableName>
      <AgentID>0</AgentID>
      <AgentName>String</AgentName>
      <IsAdmin>false</IsAdmin>
      <RecordAgentID>0</RecordAgentID>
      <RecordAgentName>String</RecordAgentName>
    </ReminderExtended>
  </Reminder>
  <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>
</ReminderResponse>