Bitrix API

EdnaruImHpx extends BaseConfigurable

Table of Contents

Constants

ID  = 'ednaruimhpx'

Methods

canUse()  : bool
Check can use state of sender.
className()  : mixed
clearOptions()  : bool
confirmRegistration()  : Result
disableDemo()  : $this
Disable demo mode.
enableDemo()  : $this
Enable demo mode.
getCallbackUrl()  : string
getConfigComponentTemplatePageName()  : string
getDefaultFrom()  : null|string
Get default From.
getExternalId()  : mixed
getExternalManageUrl()  : string
getFirstFromList()  : mixed|null
getFromList()  : mixed
getId()  : mixed
getManageUrl()  : string
getMessageStatus()  : mixed
getName()  : string
getOwnerInfo()  : array<string|int, mixed>
getServiceEndpoint()  : string
getShortName()  : string
getTemplatesList()  : array<string|int, mixed>
List of available templates for templates-based senders Should return array of templates like this:
getType()  : mixed
isConfigurable()  : mixed
isConfirmed()  : bool
Check is registration confirmed.
isCorrectFrom()  : bool
isDemo()  : bool
Check demo status.
isRegistered()  : bool
Check registration state.
isSupported()  : bool
isTemplatesBased()  : bool
Can message be created from template only
normalizePhoneNumberForOutgoing()  : string
parseIncomingRequest()  : Result
prepareMessageBodyForSave()  : string
Prepares text for message body.
prepareTemplate()  : mixed
Prepare template for save in message headers
processIncomingRequest()  : Response
processServiceResponse()  : void
Response body example: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <consumeInstantMessageResponse> <header/> <payload> <code>ok</code> <instantMessageList> <instantMessage clientId="9991144" providerId="87952036"> <code>ok</code> </instantMessage> </instantMessageList> </payload> </consumeInstantMessageResponse>
register()  : Result
resolveStatus()  : int
Converts service status to internal status
sendConfirmationCode()  : Result
sendMessage()  : SendMessage
sendTemplate()  : Result
setDefaultFrom()  : $this
Set default From.
setSocketTimeout()  : Base
setStreamTimeout()  : Base
sync()  : $this
Sync remote state (load From list etc.)

Constants

Methods

canUse()

Check can use state of sender.

public canUse() : bool
Return values
bool

className()

public static className() : mixed

confirmRegistration()

public confirmRegistration(array<string|int, mixed> $fields) : Result
Parameters
$fields : array<string|int, mixed>
Return values
Result

disableDemo()

Disable demo mode.

public disableDemo() : $this
Return values
$this

enableDemo()

Enable demo mode.

public enableDemo() : $this
Return values
$this

getCallbackUrl()

public getCallbackUrl() : string
Return values
string

getConfigComponentTemplatePageName()

public getConfigComponentTemplatePageName() : string
Return values
string

getDefaultFrom()

Get default From.

public getDefaultFrom() : null|string
Return values
null|string

getExternalId()

public getExternalId() : mixed

getExternalManageUrl()

public getExternalManageUrl() : string
Return values
string

getFirstFromList()

public getFirstFromList() : mixed|null
Return values
mixed|null

getMessageStatus()

public getMessageStatus(array<string|int, mixed> $messageFields) : mixed
Parameters
$messageFields : array<string|int, mixed>

getName()

public getName() : string
Return values
string

getOwnerInfo()

public getOwnerInfo() : array<string|int, mixed>
Return values
array<string|int, mixed>

getServiceEndpoint()

public getServiceEndpoint() : string
Return values
string

getShortName()

public getShortName() : string
Return values
string

getTemplatesList()

List of available templates for templates-based senders Should return array of templates like this:

public getTemplatesList([array<string|int, mixed>|null $context = null ]) : array<string|int, mixed>

[ ['ID' => '1', 'TITLE' => 'Template 1', 'PREVIEW' => 'Message created from template 1'], ['ID' => '2', 'TITLE' => 'Template 2', 'PREVIEW' => 'Message created from template 2'], ]

Parameters
$context : array<string|int, mixed>|null = null

Context for context-dependant templates

Return values
array<string|int, mixed>

getType()

public getType() : mixed

isConfirmed()

Check is registration confirmed.

public isConfirmed() : bool
Return values
bool

isCorrectFrom()

public isCorrectFrom(string $from) : bool
Parameters
$from : string
Return values
bool

isRegistered()

Check registration state.

public isRegistered() : bool
Return values
bool

isSupported()

public static isSupported() : bool
Return values
bool

isTemplatesBased()

Can message be created from template only

public isTemplatesBased() : bool
Return values
bool

normalizePhoneNumberForOutgoing()

public static normalizePhoneNumberForOutgoing(string $phoneNumber) : string
Parameters
$phoneNumber : string
Return values
string

parseIncomingRequest()

public parseIncomingRequest(string $incomingRequestBody) : Result
Parameters
$incomingRequestBody : string

(see example)

ok ok read 2021-03-24 10:53:55
Return values
Result

Result with []DTO\StatusUpdate

prepareMessageBodyForSave()

Prepares text for message body.

public prepareMessageBodyForSave(string $text) : string
Parameters
$text : string
Return values
string

prepareTemplate()

Prepare template for save in message headers

public prepareTemplate(mixed $templateData) : mixed
Parameters
$templateData : mixed

processIncomingRequest()

public processIncomingRequest(string $incomingRequestBody) : Response
Parameters
$incomingRequestBody : string

(see example)

ok ok read 2021-03-24 10:53:55
Return values
Response

processServiceResponse()

Response body example: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <consumeInstantMessageResponse> <header/> <payload> <code>ok</code> <instantMessageList> <instantMessage clientId="9991144" providerId="87952036"> <code>ok</code> </instantMessage> </instantMessageList> </payload> </consumeInstantMessageResponse>

public processServiceResponse(Response $response, SendMessage $result) : void

Where:

  • clientId: our message id
  • providerId: their message id
  • code: status code ("ok" or one of the error codes, like "error-syntax", "error-auth", "error-permission", etc.)
Parameters
$response : Response

Response for our send request.

$result : SendMessage

Request to be filled.

register()

public register(array<string|int, mixed> $fields) : Result
Parameters
$fields : array<string|int, mixed>
Return values
Result

resolveStatus()

Converts service status to internal status

public static resolveStatus(mixed $serviceStatus) : int
Parameters
$serviceStatus : mixed
Return values
int

sendConfirmationCode()

public sendConfirmationCode() : Result
Return values
Result

sendMessage()

public sendMessage(array<string|int, mixed> $messageFields) : SendMessage
Parameters
$messageFields : array<string|int, mixed>
Return values
SendMessage

Send operation result.

sendTemplate()

public sendTemplate(string $name, string $text[, array<string|int, mixed> $examples = [] ][, string|null $langCode = null ]) : Result
Parameters
$name : string
$text : string
$examples : array<string|int, mixed> = []
$langCode : string|null = null
Return values
Result

setDefaultFrom()

Set default From.

public setDefaultFrom(string $from) : $this
Parameters
$from : string

From.

Return values
$this

setSocketTimeout()

public setSocketTimeout(int $socketTimeout) : Base
Parameters
$socketTimeout : int
Return values
Base

setStreamTimeout()

public setStreamTimeout(int $streamTimeout) : Base
Parameters
$streamTimeout : int
Return values
Base

sync()

Sync remote state (load From list etc.)

public sync() : $this
Return values
$this

        
On this page

Search results