DigiOffice API Services Services

<back to all web services

CreateDraftCorporateIdentityMail

Requires Authentication
<?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 Outlook365Properties implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $PidTag=null,
        /** @var string|null */
        public ?string $ItemId=null,
        /** @var string|null */
        public ?string $EwsUrl=null,
        /** @var string|null */
        public ?string $Token=null
    ) {
    }

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

class FieldState implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Required=null,
        /** @var bool|null */
        public ?bool $Visible=null,
        /** @var bool|null */
        public ?bool $Readonly=null
    ) {
    }

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

class RegistrationProfileFieldStateBase extends FieldState implements JsonSerializable
{
    /**
     * @param bool|null $Required
     * @param bool|null $Visible
     * @param bool|null $Readonly
     */
    public function __construct(
        ?bool $Required=null,
        ?bool $Visible=null,
        ?bool $Readonly=null,
        /** @var string */
        public string $DocumentFieldID=''
    ) {
        parent::__construct($Required,$Visible,$Readonly);
    }

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

class CorporateIdentityMail implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $DocumentId='',
        /** @var string|null */
        public ?string $EmailHtml=null,
        /** @var bool|null */
        public ?bool $IsRegistered=null,
        /** @var string|null */
        public ?string $DocumentNr=null,
        /** @var array<RegistrationProfileFieldStateBase>|null */
        public ?array $Values=null,
        /** @var string */
        public string $RegistrationProfileID='',
        /** @var bool|null */
        public ?bool $RegisterAutomatically=null,
        /** @var string|null */
        public ?string $RegistrationEmailadress=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['DocumentId'])) $this->DocumentId = $o['DocumentId'];
        if (isset($o['EmailHtml'])) $this->EmailHtml = $o['EmailHtml'];
        if (isset($o['IsRegistered'])) $this->IsRegistered = $o['IsRegistered'];
        if (isset($o['DocumentNr'])) $this->DocumentNr = $o['DocumentNr'];
        if (isset($o['Values'])) $this->Values = JsonConverters::fromArray('RegistrationProfileFieldStateBase', $o['Values']);
        if (isset($o['RegistrationProfileID'])) $this->RegistrationProfileID = $o['RegistrationProfileID'];
        if (isset($o['RegisterAutomatically'])) $this->RegisterAutomatically = $o['RegisterAutomatically'];
        if (isset($o['RegistrationEmailadress'])) $this->RegistrationEmailadress = $o['RegistrationEmailadress'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->DocumentId)) $o['DocumentId'] = $this->DocumentId;
        if (isset($this->EmailHtml)) $o['EmailHtml'] = $this->EmailHtml;
        if (isset($this->IsRegistered)) $o['IsRegistered'] = $this->IsRegistered;
        if (isset($this->DocumentNr)) $o['DocumentNr'] = $this->DocumentNr;
        if (isset($this->Values)) $o['Values'] = JsonConverters::toArray('RegistrationProfileFieldStateBase', $this->Values);
        if (isset($this->RegistrationProfileID)) $o['RegistrationProfileID'] = $this->RegistrationProfileID;
        if (isset($this->RegisterAutomatically)) $o['RegisterAutomatically'] = $this->RegisterAutomatically;
        if (isset($this->RegistrationEmailadress)) $o['RegistrationEmailadress'] = $this->RegistrationEmailadress;
        return empty($o) ? new class(){} : $o;
    }
}

class RegistrationValue implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Key='',
        /** @var string|null */
        public ?string $Value=null,
        /** @var string|null */
        public ?string $ShadowValue=null
    ) {
    }

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

class Transition implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $ID='',
        /** @var string|null */
        public ?string $Reason=null,
        /** @var DateTime|null */
        public ?DateTime $DelayDate=null,
        /** @var string|null */
        public ?string $DelayReason=null,
        /** @var array<int>|null */
        public ?array $UserIDs=null,
        /** @var array<int>|null */
        public ?array $GroupIDs=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ID'])) $this->ID = $o['ID'];
        if (isset($o['Reason'])) $this->Reason = $o['Reason'];
        if (isset($o['DelayDate'])) $this->DelayDate = JsonConverters::from('DateTime', $o['DelayDate']);
        if (isset($o['DelayReason'])) $this->DelayReason = $o['DelayReason'];
        if (isset($o['UserIDs'])) $this->UserIDs = JsonConverters::fromArray('int', $o['UserIDs']);
        if (isset($o['GroupIDs'])) $this->GroupIDs = JsonConverters::fromArray('int', $o['GroupIDs']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ID)) $o['ID'] = $this->ID;
        if (isset($this->Reason)) $o['Reason'] = $this->Reason;
        if (isset($this->DelayDate)) $o['DelayDate'] = JsonConverters::to('DateTime', $this->DelayDate);
        if (isset($this->DelayReason)) $o['DelayReason'] = $this->DelayReason;
        if (isset($this->UserIDs)) $o['UserIDs'] = JsonConverters::toArray('int', $this->UserIDs);
        if (isset($this->GroupIDs)) $o['GroupIDs'] = JsonConverters::toArray('int', $this->GroupIDs);
        return empty($o) ? new class(){} : $o;
    }
}

class Process implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ID=0,
        /** @var string|null */
        public ?string $Title=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var string|null */
        public ?string $Note=null,
        /** @var string|null */
        public ?string $Coordinator=null,
        /** @var bool|null */
        public ?bool $Urgent=null,
        /** @var array<Transition>|null */
        public ?array $Transitions=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ID'])) $this->ID = $o['ID'];
        if (isset($o['Title'])) $this->Title = $o['Title'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Note'])) $this->Note = $o['Note'];
        if (isset($o['Coordinator'])) $this->Coordinator = $o['Coordinator'];
        if (isset($o['Urgent'])) $this->Urgent = $o['Urgent'];
        if (isset($o['Transitions'])) $this->Transitions = JsonConverters::fromArray('Transition', $o['Transitions']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ID)) $o['ID'] = $this->ID;
        if (isset($this->Title)) $o['Title'] = $this->Title;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Note)) $o['Note'] = $this->Note;
        if (isset($this->Coordinator)) $o['Coordinator'] = $this->Coordinator;
        if (isset($this->Urgent)) $o['Urgent'] = $this->Urgent;
        if (isset($this->Transitions)) $o['Transitions'] = JsonConverters::toArray('Transition', $this->Transitions);
        return empty($o) ? new class(){} : $o;
    }
}

class CreateDraftCorporateIdentityMail extends Outlook365Properties implements JsonSerializable
{
    /**
     * @param string|null $PidTag
     * @param string|null $ItemId
     * @param string|null $EwsUrl
     * @param string|null $Token
     */
    public function __construct(
        ?string $PidTag=null,
        ?string $ItemId=null,
        ?string $EwsUrl=null,
        ?string $Token=null,
        /** @var string */
        public string $RegistrationProfileID='',
        /** @var array<RegistrationValue>|null */
        public ?array $Values=null,
        /** @var array<Process>|null */
        public ?array $Processes=null,
        /** @var string|null */
        public ?string $DocumentUploadId=null,
        /** @var string|null */
        public ?string $MessageQueueId=null,
        /** @var string|null */
        public ?string $ReplyEmailHtml=null,
        /** @var string|null */
        public ?string $NewEmailHtml=null
    ) {
        parent::__construct($PidTag,$ItemId,$EwsUrl,$Token);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['RegistrationProfileID'])) $this->RegistrationProfileID = $o['RegistrationProfileID'];
        if (isset($o['Values'])) $this->Values = JsonConverters::fromArray('RegistrationValue', $o['Values']);
        if (isset($o['Processes'])) $this->Processes = JsonConverters::fromArray('Process', $o['Processes']);
        if (isset($o['DocumentUploadId'])) $this->DocumentUploadId = $o['DocumentUploadId'];
        if (isset($o['MessageQueueId'])) $this->MessageQueueId = $o['MessageQueueId'];
        if (isset($o['ReplyEmailHtml'])) $this->ReplyEmailHtml = $o['ReplyEmailHtml'];
        if (isset($o['NewEmailHtml'])) $this->NewEmailHtml = $o['NewEmailHtml'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->RegistrationProfileID)) $o['RegistrationProfileID'] = $this->RegistrationProfileID;
        if (isset($this->Values)) $o['Values'] = JsonConverters::toArray('RegistrationValue', $this->Values);
        if (isset($this->Processes)) $o['Processes'] = JsonConverters::toArray('Process', $this->Processes);
        if (isset($this->DocumentUploadId)) $o['DocumentUploadId'] = $this->DocumentUploadId;
        if (isset($this->MessageQueueId)) $o['MessageQueueId'] = $this->MessageQueueId;
        if (isset($this->ReplyEmailHtml)) $o['ReplyEmailHtml'] = $this->ReplyEmailHtml;
        if (isset($this->NewEmailHtml)) $o['NewEmailHtml'] = $this->NewEmailHtml;
        return empty($o) ? new class(){} : $o;
    }
}

PHP CreateDraftCorporateIdentityMail 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 /xml/reply/CreateDraftCorporateIdentityMail HTTP/1.1 
Host: test-do-services.klokgroep.nl 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<CreateDraftCorporateIdentityMail xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Outlook.Operations">
  <EwsUrl>String</EwsUrl>
  <ItemId>String</ItemId>
  <PidTag>String</PidTag>
  <Token>String</Token>
  <DocumentUploadId>String</DocumentUploadId>
  <MessageQueueId>String</MessageQueueId>
  <NewEmailHtml>String</NewEmailHtml>
  <Processes xmlns:d2p1="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Workflow">
    <d2p1:Process>
      <d2p1:Coordinator>String</d2p1:Coordinator>
      <d2p1:Description>String</d2p1:Description>
      <d2p1:ID>0</d2p1:ID>
      <d2p1:Note>String</d2p1:Note>
      <d2p1:Title>String</d2p1:Title>
      <d2p1:Transitions>
        <d2p1:Transition>
          <d2p1:DelayDate>0001-01-01T00:00:00</d2p1:DelayDate>
          <d2p1:DelayReason>String</d2p1:DelayReason>
          <d2p1:GroupIDs xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:int>0</d6p1:int>
          </d2p1:GroupIDs>
          <d2p1:ID>00000000-0000-0000-0000-000000000000</d2p1:ID>
          <d2p1:Reason>String</d2p1:Reason>
          <d2p1:UserIDs xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:int>0</d6p1:int>
          </d2p1:UserIDs>
        </d2p1:Transition>
      </d2p1:Transitions>
      <d2p1:Urgent>false</d2p1:Urgent>
    </d2p1:Process>
  </Processes>
  <RegistrationProfileID>00000000-0000-0000-0000-000000000000</RegistrationProfileID>
  <ReplyEmailHtml>String</ReplyEmailHtml>
  <Values xmlns:d2p1="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Registrationprofile">
    <d2p1:RegistrationValue>
      <d2p1:Key>00000000-0000-0000-0000-000000000000</d2p1:Key>
      <d2p1:ShadowValue>String</d2p1:ShadowValue>
      <d2p1:Value>String</d2p1:Value>
    </d2p1:RegistrationValue>
  </Values>
</CreateDraftCorporateIdentityMail>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CorporateIdentityMail xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Outlook">
  <DocumentId>00000000-0000-0000-0000-000000000000</DocumentId>
  <DocumentNr>String</DocumentNr>
  <EmailHtml>String</EmailHtml>
  <IsRegistered>false</IsRegistered>
  <RegisterAutomatically>false</RegisterAutomatically>
  <RegistrationEmailadress>String</RegistrationEmailadress>
  <RegistrationProfileID>00000000-0000-0000-0000-000000000000</RegistrationProfileID>
  <Values xmlns:d2p1="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Registrationprofile">
    <d2p1:RegistrationProfileFieldStateBase>
      <Readonly xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Common">false</Readonly>
      <Required xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Common">false</Required>
      <Visible xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Common">false</Visible>
      <d2p1:DocumentFieldID>00000000-0000-0000-0000-000000000000</d2p1:DocumentFieldID>
    </d2p1:RegistrationProfileFieldStateBase>
  </Values>
</CorporateIdentityMail>