Constants

SMS_LOW_COST

SMS_LOW_COST

Sms low cost sms_type param

SMS_PREMIUM

SMS_PREMIUM

Sms premium sms_type param

SMS_WORLD

SMS_WORLD

Sms world sms_type param

REAL_MODE

REAL_MODE

Sms sending real mode value param

SIMULATION_MODE

SIMULATION_MODE

Sms sending simulation mode value param

NO_DELAY

NO_DELAY

Sms sending immedialty mode value param

WITH_DELAY

WITH_DELAY

Sms sending with delay mode value param

Properties

$chars

$chars : array

Characters count as double

Type

array

$requiredKeys

$requiredKeys : array

Required Parameters for api request with api_key & user_login

Type

array

$optionalKeys

$optionalKeys : array

Optionnals Parameters for api request

Type

array

$encryptData

$encryptData : array

Data to encrypt in the url if request_keys is sets

Type

array

Methods

__construct()

__construct(array  $params = array()) 

Create a new octopush sms message

Parameters

array $params

the array params

setParams()

setParams(array  $params = array()) : \Octopush\Message

Set the parameters message

Parameters

array $params

The parameters message required and optionnals

Throws

\InvalidArgumentException

Returns

\Octopush\Message

getParams()

getParams() : array

Returns the parameters message

Returns

array —

The parameters message required and optionnal in php array format

encrypt()

encrypt(array  $params = array()) : string

Encoding request_sha1 Optionnel

Cette valeur contient le sha1 de la concaténation des valeurs des champs choisis dans la variable request_keys et concaténés dans le même ordre que les clés.

Parameters

array $params

the params

Returns

string —

the encrypt string code

setMethod()

setMethod(string  $key) : string

Set the method name from array key

Parameters

string $key

The array key

Returns

string —

The fomatted method name

setSmsRecipients()

setSmsRecipients(mixed  $recipients) : \Octopush\Message

The sms_recipients field - [Required]

List of numbers in international format + XXZZZZZ separated by commas.

Liste des numéros au format international +XXZZZZZ séparés par des ,

Parameters

mixed $recipients

numéros de phone

Returns

\Octopush\Message

setSmsText()

setSmsText(string  $text) : \Octopush\Message

The sms_text field - [Required]

Message text (maximum 459 characters).

Texte du message (maximum 459 caractères)

Parameters

string $text

The string message text

Returns

\Octopush\Message

setSmsType()

setSmsType(string  $type) : \Octopush\Message

The sms_type field - [Required]

SMS Type: XXX = Low Cost SMS; FR = Premium SMS; WWW = Global SMS. In France, if "STOP XXXXX" is missing from your text, the API will return an error.

Type de SMS : XXX = SMS LowCost ; FR = SMS Premium; WWW = SMS Monde. En France, si la mention « STOP au XXXXX » est absente de votre texte, l'API renverra une erreur.

Parameters

string $type

The message type maybe XXX | FR | WWW

Returns

\Octopush\Message

setSmsSender()

setSmsSender(string  $sender) : \Octopush\Message

Sender of the message (if the user allows it), 3-11 alphanumeric characters (a-zA-Z).

Expéditeur du message (si l'opérateur le permet), 3 à 11 caractères alpha-numériques (a-zA-Z).

Parameters

string $sender

Returns

\Octopush\Message

setRequestMode()

setRequestMode(string  $mode) : \Octopush\Message

The request_mode param Optionnel

Allows you to choose simulation mode with the value 'simu'. * Default: real

Permet de choisir le mode simulation avec la valeur 'simu'. * défaut : real

Parameters

string $mode

Returns

\Octopush\Message

setSmsMode()

setSmsMode(integer  $mode) 

The sms_mode param - [Optionnel]

Sending profile : default : 1

  • 1 = Instant sending,
  • 2 = Delayed sending (you must specify the date)

    Mode d'envoi : défaut : 1

    • 1 = Envoi Instantané,
    • 2 = Envoi Différé (il faut alors spécifier la date)

Parameters

integer $mode

@return \Octopush\Message

setSendingDate()

setSendingDate(\DateTime  $timestamp) : \Octopush\Message

The sending_date param - [Conditional]

[If mode = 2, deprecated] Timestamp, shown in GMT + 1

[Si sms_mode = 2, deprecated] Timestamp, indiqué en GMT+1

Parameters

\DateTime $timestamp

Returns

\Octopush\Message

setSendingTime()

setSendingTime(\DateTime  $timestamp) : \Octopush\Message

The sending_time param - [Optional]

Timestamp, shown in GMT + 1

Timestamp, indiqué en GMT+1

Parameters

\DateTime $timestamp

Returns

\Octopush\Message

setSendingPeriod()

setSendingPeriod(\DateTime  $timestamp) : \Octopush\Message

The sending_period param - [Optional]

Period desired (in seconds) before the sending. This field allows you to define the time before the desired date and to prevent timezone confusing

Delai souhaité avant envoi.

Ce champ vous permet de définir le temps qui vous sépare de la date souhaitée et d'éviter les confusions de timezone

Parameters

\DateTime $timestamp

Returns

\Octopush\Message

setWithReplies()

setWithReplies(integer  $withReply = true) : \Octopush\Message

The with_replies param - [Optionnel]

Set to 1 to indicate that you want answers to messages that were sent

Instancier à 1 pour indiquer que vous souhaitez les réponses aux SMS envoyés

Parameters

integer $withReply

Returns

\Octopush\Message

setTransactional()

setTransactional(boolean  $transactional = true) : \Octopush\Message

The transactional param - [Optional]

Set to 1 to confirm these messages, or alert us(24/7) to a FORMAL BAN on SMS marketing with this option (any abuse of this feature may lead to immediate account suspension and a fine of €1,000 per violation)

Instancier à 1 pour les envois de type confirmation, ou alerte (7j/7, h24) INTERDICTION FORMELLE d'envoyer du SMS marketing avec cette option (tout abus est passible d'une suspension immédiate du compte, ainsi que d'une amende de 1000€ par infraction constatée)

Parameters

boolean $transactional

Returns

\Octopush\Message

setRequestKeys()

setRequestKeys(string  $requestKeys) : \Octopush\Message

The request_keys param - [Optional]

Lists the key fields of the application you want to add in the sha1 hash. Example: 'TRYS ' (for fields sms_text, sms_recipients, sms_type, sms_sender). See the table of keys attached.

Contient la liste des clés des champs de la requête que vous souhaitez ajouter dans le hash sha1. Exemple : 'TRYS' (pour les champs sms_text, sms_recipients, sms_type, sms_sender). Voir le tableau des clés en annexe.

Parameters

string $requestKeys

Returns

\Octopush\Message

setRequestId()

setRequestId(string  $rid) : \Octopush\Message

The request_id param - [Optional]

Specifies secure sending. If the field is not null, then the system will check if there are already messages with the same request_id. If there are, the request is ignored.

Permet d'ajouter une sécurité à l'envoi. Si ce champ est différent de null, alors le système viendra vérifier s'il n'y pas déjà un de vos envois ayant le même request_id. Si c'est le cas, la requête est ignorée.

Parameters

string $rid

Returns

\Octopush\Message

setMsisdnSender()

setMsisdnSender(integer  $sender) : \Octopush\Message

The msisdn_sender param - [Optional]

Default: 0. Some operators allow international phone numbers as sender. In this case, the field must be 1.

défaut : 0. Certains opérateurs internationaux autorisent les numéros de téléphone comme émetteur. Dans ce cas, ce champ doit être à 1.

Parameters

integer $sender

Returns

\Octopush\Message

setRecipientsFirstNames()

setRecipientsFirstNames(array  $firstnames = array()) : \Octopush\Message

The recipients_first_names param - [Optional]

Replacing the string {prenom} of your message.

Remplacent la chaîne {prenom} de votre message.

Parameters

array $firstnames

The array of firstnames

Returns

\Octopush\Message

setRecipientsLastNames()

setRecipientsLastNames(array  $lastnames = array()) : \Octopush\Message

The recipients_last_names - [Optional]

Replacing {nom} string of your message.

Remplacent la chaîne {nom} de votre message.

Parameters

array $lastnames

The array of lastnames

Returns

\Octopush\Message

setSmsFields1()

setSmsFields1(array  $fields = array()) : \Octopush\Message

The sms_fields_1 param - [Optional]

Replacing the string {ch1} of your message.

Remplacent la chaîne {ch1} de votre message.

Parameters

array $fields

The array of ch1 string value

Returns

\Octopush\Message

setSmsFields2()

setSmsFields2(array  $fields = array()) : \Octopush\Message

The sms_fields_2 param - [Optional]

Replacing the string {ch2} of your message.

Remplacent la chaîne {ch2} de votre message.

Parameters

array $fields

The array of ch2 string value

Returns

\Octopush\Message

setSmsFields3()

setSmsFields3(array  $fields = array()) : \Octopush\Message

The sms_fields_3 param - [Optional]

Replacing the string {ch3} of your message.

Remplacent la chaîne {ch3} de votre message.

Parameters

array $fields

The array of ch3 string value

Returns

\Octopush\Message