WhatsApp and Chatwoot

AbstractChatwootApi extends AbstractHttpRequest
in package

AbstractYes

Implements raw methods for communicating with the API.

Must only contain http requests to the API. Should not process the responses.

Tags
link
https://www.chatwoot.com/developers/api/
since
3.0.0

Table of Contents

Methods

closeConversation()  : mixed
createContact()  : array<string|int, mixed>
createConversation()  : void
getContactConversations()  : array<string|int, mixed>
request()  : array<string|int, mixed>
Performs a request to Chatwoot's API.
searchContact()  : array<string|int, mixed>
sendMessageToConversation()  : array<string|int, mixed>
httpRequest()  : false|null|array<string|int, mixed>
response()  : array<string|int, mixed>
Provides a standardized way to return API responses to notifications.

Methods

request()

Performs a request to Chatwoot's API.

public final request(string $method, string $endpoint[, array<string|int, mixed> $body = [] ][, array<string|int, mixed> $headers = [] ]) : array<string|int, mixed>
Parameters
$method : string
$endpoint : string
$body : array<string|int, mixed> = []
$headers : array<string|int, mixed> = []
Tags
since
3.0.0
Return values
array<string|int, mixed>

raw API response converted to array or an empty array on failure.

sendMessageToConversation()

public final sendMessageToConversation(int $conversationId, string $content[, string $contentType = 'text' ][, string $msgType = 'outgoing' ][, bool $private = false ][, array<string|int, mixed> $contentAttrs = [] ]) : array<string|int, mixed>
Parameters
$conversationId : int
$content : string
$contentType : string = 'text'
$msgType : string = 'outgoing'

outgoing or incoming

$private : bool = false
$contentAttrs : array<string|int, mixed> = []
Tags
since
3.0.0
link
https://www.chatwoot.com/developers/api/#tag/Messages/operation/create-a-new-message-in-a-conversation
Return values
array<string|int, mixed>

returns the message ID.

httpRequest()

protected httpRequest(string $method, string $baseUrl, string $endpoint[, array<string|int, mixed> $body = [] ][, array<string|int, mixed> $headers = [] ]) : false|null|array<string|int, mixed>
Parameters
$method : string
$baseUrl : string
$endpoint : string
$body : array<string|int, mixed> = []
$headers : array<string|int, mixed> = []
Tags
since
3.0.0
Return values
false|null|array<string|int, mixed>

false may be returned also due to license problems.

response()

Provides a standardized way to return API responses to notifications.

protected response(bool $success[, array<string|int, mixed> $data = [] ]) : array<string|int, mixed>
Parameters
$success : bool
$data : array<string|int, mixed> = []
Tags
since
3.0.0
Return values
array<string|int, mixed>

        
On this page

Search results