Trendsic Platform Service

<back to all web services

BranchApptCreateRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
POST,OPTIONS/v1/queue/appointments
<?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 BranchApptWriteResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var int */
        public int $CalendarEventId=0,
        /** @var string */
        public string $CheckInId='',
        /** @var DateTime|null */
        public ?DateTime $StartLocal=null,
        /** @var DateTime|null */
        public ?DateTime $EndLocal=null,
        /** @var int */
        public int $ContactId=0,
        /** @var bool|null */
        public ?bool $ContactExisted=null,
        /** @var bool|null */
        public ?bool $Notified=null,
        /** @var int|null */
        public ?int $Open=null,
        /** @var int|null */
        public ?int $Capacity=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
        if (isset($o['CalendarEventId'])) $this->CalendarEventId = $o['CalendarEventId'];
        if (isset($o['CheckInId'])) $this->CheckInId = $o['CheckInId'];
        if (isset($o['StartLocal'])) $this->StartLocal = JsonConverters::from('DateTime', $o['StartLocal']);
        if (isset($o['EndLocal'])) $this->EndLocal = JsonConverters::from('DateTime', $o['EndLocal']);
        if (isset($o['ContactId'])) $this->ContactId = $o['ContactId'];
        if (isset($o['ContactExisted'])) $this->ContactExisted = $o['ContactExisted'];
        if (isset($o['Notified'])) $this->Notified = $o['Notified'];
        if (isset($o['Open'])) $this->Open = $o['Open'];
        if (isset($o['Capacity'])) $this->Capacity = $o['Capacity'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        if (isset($this->CalendarEventId)) $o['CalendarEventId'] = $this->CalendarEventId;
        if (isset($this->CheckInId)) $o['CheckInId'] = $this->CheckInId;
        if (isset($this->StartLocal)) $o['StartLocal'] = JsonConverters::to('DateTime', $this->StartLocal);
        if (isset($this->EndLocal)) $o['EndLocal'] = JsonConverters::to('DateTime', $this->EndLocal);
        if (isset($this->ContactId)) $o['ContactId'] = $this->ContactId;
        if (isset($this->ContactExisted)) $o['ContactExisted'] = $this->ContactExisted;
        if (isset($this->Notified)) $o['Notified'] = $this->Notified;
        if (isset($this->Open)) $o['Open'] = $this->Open;
        if (isset($this->Capacity)) $o['Capacity'] = $this->Capacity;
        return empty($o) ? new class(){} : $o;
    }
}

class BranchApptNewContact implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Phone=null,
        /** @var string|null */
        public ?string $Email=null
    ) {
    }

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

class BranchApptCreateRequest implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $LocationId='',
        /** @var string|null */
        public ?string $Date=null,
        /** @var string|null */
        public ?string $StartLocal=null,
        /** @var array<string>|null */
        public ?array $LineIds=null,
        /** @var int|null */
        public ?int $ContactId=null,
        /** @var BranchApptNewContact|null */
        public ?BranchApptNewContact $NewContact=null,
        /** @var string|null */
        public ?string $Via=null,
        /** @var bool|null */
        public ?bool $Notify=null,
        /** @var string|null */
        public ?string $Note=null,
        /** @var bool|null */
        public ?bool $Overbook=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['LocationId'])) $this->LocationId = $o['LocationId'];
        if (isset($o['Date'])) $this->Date = $o['Date'];
        if (isset($o['StartLocal'])) $this->StartLocal = $o['StartLocal'];
        if (isset($o['LineIds'])) $this->LineIds = JsonConverters::fromArray('Guid', $o['LineIds']);
        if (isset($o['ContactId'])) $this->ContactId = $o['ContactId'];
        if (isset($o['NewContact'])) $this->NewContact = JsonConverters::from('BranchApptNewContact', $o['NewContact']);
        if (isset($o['Via'])) $this->Via = $o['Via'];
        if (isset($o['Notify'])) $this->Notify = $o['Notify'];
        if (isset($o['Note'])) $this->Note = $o['Note'];
        if (isset($o['Overbook'])) $this->Overbook = $o['Overbook'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->LocationId)) $o['LocationId'] = $this->LocationId;
        if (isset($this->Date)) $o['Date'] = $this->Date;
        if (isset($this->StartLocal)) $o['StartLocal'] = $this->StartLocal;
        if (isset($this->LineIds)) $o['LineIds'] = JsonConverters::toArray('Guid', $this->LineIds);
        if (isset($this->ContactId)) $o['ContactId'] = $this->ContactId;
        if (isset($this->NewContact)) $o['NewContact'] = JsonConverters::to('BranchApptNewContact', $this->NewContact);
        if (isset($this->Via)) $o['Via'] = $this->Via;
        if (isset($this->Notify)) $o['Notify'] = $this->Notify;
        if (isset($this->Note)) $o['Note'] = $this->Note;
        if (isset($this->Overbook)) $o['Overbook'] = $this->Overbook;
        return empty($o) ? new class(){} : $o;
    }
}

PHP BranchApptCreateRequest 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/queue/appointments HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<BranchApptCreateRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <ContactId>0</ContactId>
  <Date>String</Date>
  <LineIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:guid>00000000-0000-0000-0000-000000000000</d2p1:guid>
  </LineIds>
  <LocationId>00000000-0000-0000-0000-000000000000</LocationId>
  <NewContact>
    <Email>String</Email>
    <Name>String</Name>
    <Phone>String</Phone>
  </NewContact>
  <Note>String</Note>
  <Notify>false</Notify>
  <Overbook>false</Overbook>
  <StartLocal>String</StartLocal>
  <Via>String</Via>
</BranchApptCreateRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<BranchApptWriteResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <CalendarEventId>0</CalendarEventId>
  <Capacity>0</Capacity>
  <CheckInId>00000000-0000-0000-0000-000000000000</CheckInId>
  <ContactExisted>false</ContactExisted>
  <ContactId>0</ContactId>
  <EndLocal>0001-01-01T00:00:00</EndLocal>
  <Notified>false</Notified>
  <Open>0</Open>
  <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>
  <StartLocal>0001-01-01T00:00:00</StartLocal>
</BranchApptWriteResponse>