Overview

Namespaces

  • None
  • PHP
  • SMSJuiceAPI

Classes

  • ContactGroup
  • Message
  • TextMessagingService
  • Overview
  • Namespace
  • Class
  • Tree

Class Message

Namespace: SMSJuiceAPI
Located at SMSJuice-API/class/Message.php
Methods summary
public
# __construct( type $key, type $secret )

Creates a Message Object which will store all the details needed to send a message to recipients through the SMSJuice API

Creates a Message Object which will store all the details needed to send a message to recipients through the SMSJuice API

Parameters

$key
API Key found in the settings section of your account
$secret
API Secret found in the settings section of your account
public
# setSender( type $sender )

Set the senderID, this is equivalent to the "From" field

Set the senderID, this is equivalent to the "From" field

Parameters

$sender
This is the name/number the recipient will receive the message from.

Throws

Exception
Thrown when sender is null, empty or invalid
public
# setRecipientList( type $recipient_list )

Sets the recipient list, and filters out all invalid recipient numbers

Sets the recipient list, and filters out all invalid recipient numbers

Parameters

$recipient_list
Array of recipients or groups that will receive the message.
public
# addToRecipientList( type $recipient )

Adds a number to the recipient list

Adds a number to the recipient list

Parameters

$recipient
public
# setRecipientType( type $type )

Set the type of recipient, either "numbers" for contacts put in the recipients list OR "groups" for names of groups on your account.

Set the type of recipient, either "numbers" for contacts put in the recipients list OR "groups" for names of groups on your account.

Parameters

$type
Sets the type of recipients you will be sending to. Whether it will be a list of groups on your account or a number

Throws

Exception
public
# setMessage( String $message )

The message to be sent to the recipient(s)

The message to be sent to the recipient(s)

Parameters

$message
The message to be sent to the recipients
public
# setSendDate( String $schedule )

The date and time at which the message can be sent. It is not mandatory to set this. If set, it has to be in 'Y-m-d H:i:s' format. Example -> '2015-03-27 15:00'

The date and time at which the message can be sent. It is not mandatory to set this. If set, it has to be in 'Y-m-d H:i:s' format. Example -> '2015-03-27 15:00'

Parameters

$schedule
The unchecked date value
public
# setExpiryDate( String $expiry )

setExpiryDate - The date and time at which the message would expire if not delivered yet. It is not mandatory to set this. If set, it has to be in 'Y-m-d H:i' format. Example -> '2015-03-27 15:00'. Only works if send date has been set, and the default expiry period is 2 days fromt he date of sending

setExpiryDate - The date and time at which the message would expire if not delivered yet. It is not mandatory to set this. If set, it has to be in 'Y-m-d H:i' format. Example -> '2015-03-27 15:00'. Only works if send date has been set, and the default expiry period is 2 days fromt he date of sending

Parameters

$expiry
The unchecked date value
public
# setEncoding( type $encoding )

Message encoding, which identifies what characterset is used to write and send the message

Message encoding, which identifies what characterset is used to write and send the message

Parameters

$encoding
encoding value of the message. Recommended values : 0,3 and 8
public String
# toJSON( )

Returns a JSON string representation of the Message object. Null values are ignored

Returns a JSON string representation of the Message object. Null values are ignored

Returns

String
JSON string representing the serialized object

Throws

Exception
Thrown when mandatory fields are left null, empty or invalid
Constants summary
integer RECIPIENT
# 0
integer SENDER
# 1
boolean LONG_MESSAGE_SET
# true
boolean NORMAL_MESSAGE_SET
# true
smsjuice-API-PHP-wrapper API documentation generated by ApiGen