Table of Contents
Interfaces
- Adapter
- HandlesSlashCommands
- HandlesStatuses
Constants
-
ADAPTER_NAME
: mixed = 'telnyx-chat-sdk-php'
-
ADAPTER_VERSION
: mixed = '0.2.5'
-
USER_AGENT
: mixed = self::ADAPTER_NAME . '/' . self::ADAPTER_VERSION
Properties
-
$agentId
: string|null
-
$apiKey
: string
-
$apiUrl
: string
-
$disableAttributionTags
: bool
-
$extraTags
: array<string|int, mixed>
-
$fileUploadConverter
: FileUploadConverter
-
$formatConverter
: TelnyxFormatConverter
-
$fromNumber
: string|null
-
$httpClient
: ClientInterface
-
$messagingProfileId
: string|null
-
$psrFactory
: Psr17Factory|null
-
$webhookVerifier
: TelnyxWebhookVerifier|null
Methods
-
__construct()
: mixed
-
addReaction()
: void
-
channelIdFromThreadId()
: string
-
createResponse()
: ResponseInterface|null
-
decodeThreadId()
: mixed
-
deleteMessage()
: void
-
disconnect()
: void
-
editMessage()
: SentMessage
-
encodeThreadId()
: string
-
fetchChannelInfo()
: ChannelInfo|null
-
fetchMessages()
: FetchResult
-
fetchThread()
: ThreadInfo
-
getBotUserId()
: string|null
-
getFormatConverter()
: FormatConverter|null
-
getName()
: string
-
getUser()
: UserInfo|null
-
initialize()
: void
-
openDM()
: string|null
-
parseSlashCommand()
: Author, command: string, text: string, userId: string, isBot: bool, isMe: bool, channelId: string, triggerId: ?string, raw: mixed}|null
-
parseStatus()
: array{type: "delivered"|"read"|"failed", messageIds: string[], threadId: string, userId: string, raw: mixed, timestamp: ?int, originId: ?string}|null
-
parseWebhook()
: Message
-
postMessage()
: SentMessage
-
removeReaction()
: void
-
startTyping()
: void
-
stream()
: SentMessage|null
-
verifyWebhook()
: ResponseInterface|null
-
apiCall()
: array<string|int, mixed>
-
buildRcsCardContent()
: array<string|int, mixed>
-
buildSmsParams()
: array<string|int, mixed>
-
parseRcsMessage()
: Message
-
parseSmsMessage()
: Message
-
sendRcs()
: array<string|int, mixed>
-
sendRcsContent()
: array<string|int, mixed>
-
sendSms()
: array<string|int, mixed>
-
buildTags()
: array<string|int, mixed>
ADAPTER_NAME
private
mixed
ADAPTER_NAME
= 'telnyx-chat-sdk-php'
ADAPTER_VERSION
private
mixed
ADAPTER_VERSION
= '0.2.5'
USER_AGENT
private
mixed
USER_AGENT
= self::ADAPTER_NAME . '/' . self::ADAPTER_VERSION
$agentId
read-only
protected
string|null
$agentId
= null
$apiKey
read-only
protected
string
$apiKey
$apiUrl
read-only
protected
string
$apiUrl
= 'https://api.telnyx.com/v2/'
protected
bool
$disableAttributionTags
= false
protected
array<string|int, mixed>
$extraTags
= []
$fileUploadConverter
protected
FileUploadConverter
$fileUploadConverter
protected
TelnyxFormatConverter
$formatConverter
$fromNumber
read-only
protected
string|null
$fromNumber
= null
$httpClient
read-only
protected
ClientInterface
$httpClient
$messagingProfileId
read-only
protected
string|null
$messagingProfileId
= null
$psrFactory
read-only
protected
Psr17Factory|null
$psrFactory
= null
$webhookVerifier
protected
TelnyxWebhookVerifier|null
$webhookVerifier
= null
__construct()
public
__construct(string $apiKey, ClientInterface $httpClient[, string|null $messagingProfileId = null ][, string|null $publicKey = null ][, string|null $fromNumber = null ][, string|null $agentId = null ][, string $apiUrl = 'https://api.telnyx.com/v2/' ][, Psr17Factory|null $psrFactory = null ][, FileUploadConverter|null $fileUploadConverter = null ][, array<string|int, mixed> $extraTags = [] ][, bool $disableAttributionTags = false ]) : mixed
Parameters
-
$apiKey
: string
-
-
$httpClient
: ClientInterface
-
-
$messagingProfileId
: string|null
= null
-
-
$publicKey
: string|null
= null
-
-
$fromNumber
: string|null
= null
-
-
$agentId
: string|null
= null
-
-
$apiUrl
: string
= 'https://api.telnyx.com/v2/'
-
-
$psrFactory
: Psr17Factory|null
= null
-
-
$fileUploadConverter
: FileUploadConverter|null
= null
-
-
$extraTags
: array<string|int, mixed>
= []
-
-
$disableAttributionTags
: bool
= false
-
addReaction()
public
addReaction(string $threadId, string $messageId, string $emoji) : void
Parameters
-
$threadId
: string
-
-
$messageId
: string
-
-
$emoji
: string
-
channelIdFromThreadId()
public
channelIdFromThreadId(string $threadId) : string
Parameters
-
$threadId
: string
-
createResponse()
public
createResponse() : ResponseInterface|null
Return values
ResponseInterface|null
decodeThreadId()
public
decodeThreadId(string $threadId) : mixed
Parameters
-
$threadId
: string
-
deleteMessage()
public
deleteMessage(string $threadId, string $messageId) : void
Parameters
-
$threadId
: string
-
-
$messageId
: string
-
disconnect()
public
disconnect() : void
editMessage()
public
editMessage(string $threadId, string $messageId, PostableMessage $message) : SentMessage
Parameters
-
$threadId
: string
-
-
$messageId
: string
-
-
$message
: PostableMessage
-
encodeThreadId()
public
encodeThreadId(mixed $platformData) : string
Parameters
-
$platformData
: mixed
-
fetchChannelInfo()
public
fetchChannelInfo(string $channelId) : ChannelInfo|null
Parameters
-
$channelId
: string
-
fetchMessages()
public
fetchMessages(string $threadId[, FetchOptions|null $options = null ]) : FetchResult
Parameters
-
$threadId
: string
-
-
$options
: FetchOptions|null
= null
-
fetchThread()
public
fetchThread(string $threadId) : ThreadInfo
Parameters
-
$threadId
: string
-
getBotUserId()
public
getBotUserId() : string|null
Return values
string|null
public
getFormatConverter() : FormatConverter|null
getName()
public
getName() : string
getUser()
public
getUser(string $userId) : UserInfo|null
Parameters
-
$userId
: string
-
initialize()
public
initialize(Chat $chat) : void
Parameters
-
$chat
: Chat
-
openDM()
public
openDM(string $userId) : string|null
Parameters
-
$userId
: string
-
Return values
string|null
parseSlashCommand()
public
parseSlashCommand(ServerRequestInterface $request) : Author, command: string, text: string, userId: string, isBot: bool, isMe: bool, channelId: string, triggerId: ?string, raw: mixed}|null
Parameters
-
$request
: ServerRequestInterface
-
Return values
Author, command: string, text: string, userId: string, isBot: bool, isMe: bool, channelId: string, triggerId: ?string, raw: mixed}|null
parseStatus()
public
parseStatus(ServerRequestInterface $request) : array{type: "delivered"|"read"|"failed", messageIds: string[], threadId: string, userId: string, raw: mixed, timestamp: ?int, originId: ?string}|null
Parameters
-
$request
: ServerRequestInterface
-
Return values
array{type: "delivered"|"read"|"failed", messageIds: string[], threadId: string, userId: string, raw: mixed, timestamp: ?int, originId: ?string}|null
parseWebhook()
public
parseWebhook(ServerRequestInterface $request) : Message
Parameters
-
$request
: ServerRequestInterface
-
postMessage()
public
postMessage(string $threadId, PostableMessage $message) : SentMessage
Parameters
-
$threadId
: string
-
-
$message
: PostableMessage
-
removeReaction()
public
removeReaction(string $threadId, string $messageId, string $emoji) : void
Parameters
-
$threadId
: string
-
-
$messageId
: string
-
-
$emoji
: string
-
startTyping()
public
startTyping(string $threadId) : void
Parameters
-
$threadId
: string
-
stream()
public
stream(string $threadId, iterable<string|int, mixed> $textStream[, array<string|int, mixed> $options = [] ]) : SentMessage|null
Parameters
-
$threadId
: string
-
-
$textStream
: iterable<string|int, mixed>
-
-
$options
: array<string|int, mixed>
= []
-
verifyWebhook()
public
verifyWebhook(ServerRequestInterface $request) : ResponseInterface|null
Parameters
-
$request
: ServerRequestInterface
-
Return values
ResponseInterface|null
apiCall()
protected
apiCall(string $endpoint, array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
-
$endpoint
: string
-
-
$params
: array<string|int, mixed>
-
Return values
array<string|int, mixed>
buildRcsCardContent()
protected
buildRcsCardContent(Card $card) : array<string|int, mixed>
Parameters
-
$card
: Card
-
Return values
array<string|int, mixed>
buildSmsParams()
protected
buildSmsParams(PostableMessage $message) : array<string|int, mixed>
Parameters
-
$message
: PostableMessage
-
Return values
array<string|int, mixed>
parseRcsMessage()
protected
parseRcsMessage(array<string|int, mixed> $p, string $rawBody) : Message
Parameters
-
$p
: array<string|int, mixed>
-
-
$rawBody
: string
-
parseSmsMessage()
protected
parseSmsMessage(array<string|int, mixed> $p, string $rawBody) : Message
Parameters
-
$p
: array<string|int, mixed>
-
-
$rawBody
: string
-
sendRcs()
protected
sendRcs(string $to, PostableMessage $message) : array<string|int, mixed>
Parameters
-
$to
: string
-
-
$message
: PostableMessage
-
Return values
array<string|int, mixed>
sendRcsContent()
protected
sendRcsContent(string $to, string $messagingProfileId, array<string|int, mixed> $content[, string|null $fallbackText = null ][, array<string|int, mixed> $attachmentUrls = [] ][, bool $first = false ]) : array<string|int, mixed>
Parameters
-
$to
: string
-
-
$messagingProfileId
: string
-
-
$content
: array<string|int, mixed>
-
-
$fallbackText
: string|null
= null
-
-
$attachmentUrls
: array<string|int, mixed>
= []
-
-
$first
: bool
= false
-
Return values
array<string|int, mixed>
sendSms()
protected
sendSms(string $from, string $to, PostableMessage $message) : array<string|int, mixed>
Parameters
-
$from
: string
-
-
$to
: string
-
-
$message
: PostableMessage
-
Return values
array<string|int, mixed>
private
buildTags() : array<string|int, mixed>
Return values
array<string|int, mixed>