Evo Voice

<back to all web services

LiveAnswerSendEmail

The following routes are available for this service:
All Verbs/nodes/live-answer/email
<?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 LiveAnswerEmailRecipient implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $name=null,
        /** @var string|null */
        public ?string $address=null
    ) {
    }

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

class LiveAnswerSendEmail implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $flowId=null,
        /** @var string|null */
        public ?string $sessionId=null,
        /** @var string|null */
        public ?string $nodeId=null,
        /** @var string|null */
        public ?string $clientId=null,
        /** @var string|null */
        public ?string $subject=null,
        /** @var string|null */
        public ?string $body=null,
        /** @var array<LiveAnswerEmailRecipient>|null */
        public ?array $to=null,
        /** @var array<LiveAnswerEmailRecipient>|null */
        public ?array $cc=null,
        /** @var array<LiveAnswerEmailRecipient>|null */
        public ?array $bcc=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['flowId'])) $this->flowId = $o['flowId'];
        if (isset($o['sessionId'])) $this->sessionId = $o['sessionId'];
        if (isset($o['nodeId'])) $this->nodeId = $o['nodeId'];
        if (isset($o['clientId'])) $this->clientId = $o['clientId'];
        if (isset($o['subject'])) $this->subject = $o['subject'];
        if (isset($o['body'])) $this->body = $o['body'];
        if (isset($o['to'])) $this->to = JsonConverters::fromArray('LiveAnswerEmailRecipient', $o['to']);
        if (isset($o['cc'])) $this->cc = JsonConverters::fromArray('LiveAnswerEmailRecipient', $o['cc']);
        if (isset($o['bcc'])) $this->bcc = JsonConverters::fromArray('LiveAnswerEmailRecipient', $o['bcc']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->flowId)) $o['flowId'] = $this->flowId;
        if (isset($this->sessionId)) $o['sessionId'] = $this->sessionId;
        if (isset($this->nodeId)) $o['nodeId'] = $this->nodeId;
        if (isset($this->clientId)) $o['clientId'] = $this->clientId;
        if (isset($this->subject)) $o['subject'] = $this->subject;
        if (isset($this->body)) $o['body'] = $this->body;
        if (isset($this->to)) $o['to'] = JsonConverters::toArray('LiveAnswerEmailRecipient', $this->to);
        if (isset($this->cc)) $o['cc'] = JsonConverters::toArray('LiveAnswerEmailRecipient', $this->cc);
        if (isset($this->bcc)) $o['bcc'] = JsonConverters::toArray('LiveAnswerEmailRecipient', $this->bcc);
        return empty($o) ? new class(){} : $o;
    }
}

PHP LiveAnswerSendEmail 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 /nodes/live-answer/email HTTP/1.1 
Host: evovoice.io 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<LiveAnswerSendEmail xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Nodes.AI">
  <Bcc>
    <LiveAnswerEmailRecipient>
      <Address>String</Address>
      <Name>String</Name>
    </LiveAnswerEmailRecipient>
  </Bcc>
  <Body>String</Body>
  <Cc>
    <LiveAnswerEmailRecipient>
      <Address>String</Address>
      <Name>String</Name>
    </LiveAnswerEmailRecipient>
  </Cc>
  <ClientId>String</ClientId>
  <FlowId>String</FlowId>
  <NodeId>String</NodeId>
  <SessionId>String</SessionId>
  <Subject>String</Subject>
  <To>
    <LiveAnswerEmailRecipient>
      <Address>String</Address>
      <Name>String</Name>
    </LiveAnswerEmailRecipient>
  </To>
</LiveAnswerSendEmail>