Evo Voice

<back to all web services

ChatEventsNodeNewMessageCallback

The following routes are available for this service:
All Verbs/nodes/chat-events/new-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 ChatEventsNodeNewMessageCallback implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $accountId=null,
        /** @var string|null */
        public ?string $endpointId=null,
        /** @var string|null */
        public ?string $sessionId=null,
        /** @var string|null */
        public ?string $body=null,
        /** @var string|null */
        public ?string $sender=null,
        /** @var string|null */
        public ?string $senderDisplayName=null,
        /** @var string|null */
        public ?string $attachmentUri=null,
        /** @var string|null */
        public ?string $attachmentContentType=null,
        /** @var string|null */
        public ?string $newMessage=null,
        /** @var string|null */
        public ?string $newMessageBody=null,
        /** @var string|null */
        public ?string $newMessageSender=null
    ) {
    }

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

PHP ChatEventsNodeNewMessageCallback DTOs

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

HTTP + CSV

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

POST /nodes/chat-events/new-message HTTP/1.1 
Host: team.evovoice.io 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"accountId":"String","endpointId":"String","sessionId":"String","body":"String","sender":"String","senderDisplayName":"String","attachmentUri":"String","attachmentContentType":"String","newMessage":"String","newMessageBody":"String","newMessageSender":"String"}