Trendsic Platform Service

<back to all web services

CustomerNotesRequest

Requires Authentication
Requires any of the roles:Agent, Administrator, Agent, Administrator
The following routes are available for this service:
GET,POST,OPTIONS/v1/customercheckins/{Id}/notes
<?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 CustomerNote implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $NoteId=0,
        /** @var string|null */
        public ?string $Scope=null,
        /** @var string|null */
        public ?string $Text=null,
        /** @var bool|null */
        public ?bool $IsPriority=null,
        /** @var string|null */
        public ?string $CreatedByUserId=null,
        /** @var string|null */
        public ?string $CreatedByName=null,
        /** @var DateTime|null */
        public ?DateTime $CreatedAt=null,
        /** @var DateTime|null */
        public ?DateTime $DoneAt=null,
        /** @var bool|null */
        public ?bool $IsCarry=null,
        /** @var DateTime|null */
        public ?DateTime $ShownAt=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['NoteId'])) $this->NoteId = $o['NoteId'];
        if (isset($o['Scope'])) $this->Scope = $o['Scope'];
        if (isset($o['Text'])) $this->Text = $o['Text'];
        if (isset($o['IsPriority'])) $this->IsPriority = $o['IsPriority'];
        if (isset($o['CreatedByUserId'])) $this->CreatedByUserId = $o['CreatedByUserId'];
        if (isset($o['CreatedByName'])) $this->CreatedByName = $o['CreatedByName'];
        if (isset($o['CreatedAt'])) $this->CreatedAt = JsonConverters::from('DateTime', $o['CreatedAt']);
        if (isset($o['DoneAt'])) $this->DoneAt = JsonConverters::from('DateTime', $o['DoneAt']);
        if (isset($o['IsCarry'])) $this->IsCarry = $o['IsCarry'];
        if (isset($o['ShownAt'])) $this->ShownAt = JsonConverters::from('DateTime', $o['ShownAt']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->NoteId)) $o['NoteId'] = $this->NoteId;
        if (isset($this->Scope)) $o['Scope'] = $this->Scope;
        if (isset($this->Text)) $o['Text'] = $this->Text;
        if (isset($this->IsPriority)) $o['IsPriority'] = $this->IsPriority;
        if (isset($this->CreatedByUserId)) $o['CreatedByUserId'] = $this->CreatedByUserId;
        if (isset($this->CreatedByName)) $o['CreatedByName'] = $this->CreatedByName;
        if (isset($this->CreatedAt)) $o['CreatedAt'] = JsonConverters::to('DateTime', $this->CreatedAt);
        if (isset($this->DoneAt)) $o['DoneAt'] = JsonConverters::to('DateTime', $this->DoneAt);
        if (isset($this->IsCarry)) $o['IsCarry'] = $this->IsCarry;
        if (isset($this->ShownAt)) $o['ShownAt'] = JsonConverters::to('DateTime', $this->ShownAt);
        return empty($o) ? new class(){} : $o;
    }
}

class CustomerNoteResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var array<CustomerNote>|null */
        public ?array $Notes=null,
        /** @var array<CustomerNote>|null */
        public ?array $Carry=null,
        /** @var bool|null */
        public ?bool $CanPriority=null,
        /** @var CustomerNote|null */
        public ?CustomerNote $Note=null
    ) {
    }

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

class CustomerNotesRequest implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Id='',
        /** @var string|null */
        public ?string $Text=null,
        /** @var string|null */
        public ?string $Scope=null,
        /** @var bool|null */
        public ?bool $IsPriority=null
    ) {
    }

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

PHP CustomerNotesRequest 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/customercheckins/{Id}/notes HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<CustomerNotesRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Id>00000000-0000-0000-0000-000000000000</Id>
  <IsPriority>false</IsPriority>
  <Scope>String</Scope>
  <Text>String</Text>
</CustomerNotesRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CustomerNoteResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <CanPriority>false</CanPriority>
  <Carry>
    <CustomerNote>
      <CreatedAt>0001-01-01T00:00:00</CreatedAt>
      <CreatedByName>String</CreatedByName>
      <CreatedByUserId>00000000-0000-0000-0000-000000000000</CreatedByUserId>
      <DoneAt>0001-01-01T00:00:00</DoneAt>
      <IsCarry>false</IsCarry>
      <IsPriority>false</IsPriority>
      <NoteId>0</NoteId>
      <Scope>String</Scope>
      <ShownAt>0001-01-01T00:00:00</ShownAt>
      <Text>String</Text>
    </CustomerNote>
  </Carry>
  <Note>
    <CreatedAt>0001-01-01T00:00:00</CreatedAt>
    <CreatedByName>String</CreatedByName>
    <CreatedByUserId>00000000-0000-0000-0000-000000000000</CreatedByUserId>
    <DoneAt>0001-01-01T00:00:00</DoneAt>
    <IsCarry>false</IsCarry>
    <IsPriority>false</IsPriority>
    <NoteId>0</NoteId>
    <Scope>String</Scope>
    <ShownAt>0001-01-01T00:00:00</ShownAt>
    <Text>String</Text>
  </Note>
  <Notes>
    <CustomerNote>
      <CreatedAt>0001-01-01T00:00:00</CreatedAt>
      <CreatedByName>String</CreatedByName>
      <CreatedByUserId>00000000-0000-0000-0000-000000000000</CreatedByUserId>
      <DoneAt>0001-01-01T00:00:00</DoneAt>
      <IsCarry>false</IsCarry>
      <IsPriority>false</IsPriority>
      <NoteId>0</NoteId>
      <Scope>String</Scope>
      <ShownAt>0001-01-01T00:00:00</ShownAt>
      <Text>String</Text>
    </CustomerNote>
  </Notes>
  <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>
</CustomerNoteResponse>