Evo Voice

<back to all web services

SendEndpointMessage

The following routes are available for this service:
All Verbs/chat/endpoint/message
<?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 SendEndpointMessage implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $sessionId=null,
        /** @var string|null */
        public ?string $endpointId=null,
        /** @var string|null */
        public ?string $body=null,
        /** @var string|null */
        public ?string $attachmentUri=null,
        /** @var string|null */
        public ?string $attachmentContentType=null,
        /** @var string|null */
        public ?string $sender=null,
        /** @var string|null */
        public ?string $displayName=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['sessionId'])) $this->sessionId = $o['sessionId'];
        if (isset($o['endpointId'])) $this->endpointId = $o['endpointId'];
        if (isset($o['body'])) $this->body = $o['body'];
        if (isset($o['attachmentUri'])) $this->attachmentUri = $o['attachmentUri'];
        if (isset($o['attachmentContentType'])) $this->attachmentContentType = $o['attachmentContentType'];
        if (isset($o['sender'])) $this->sender = $o['sender'];
        if (isset($o['displayName'])) $this->displayName = $o['displayName'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->sessionId)) $o['sessionId'] = $this->sessionId;
        if (isset($this->endpointId)) $o['endpointId'] = $this->endpointId;
        if (isset($this->body)) $o['body'] = $this->body;
        if (isset($this->attachmentUri)) $o['attachmentUri'] = $this->attachmentUri;
        if (isset($this->attachmentContentType)) $o['attachmentContentType'] = $this->attachmentContentType;
        if (isset($this->sender)) $o['sender'] = $this->sender;
        if (isset($this->displayName)) $o['displayName'] = $this->displayName;
        return empty($o) ? new class(){} : $o;
    }
}

PHP SendEndpointMessage DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /chat/endpoint/message HTTP/1.1 
Host: team.evovoice.io 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"sessionId":"String","endpointId":"String","body":"String","attachmentUri":"String","attachmentContentType":"String","sender":"String","displayName":"String"}