Bulk SMS Solutions from SMSJuice - Your home For Text Messaging Solutions - api send message

Developers: You can integrate your system with ours!

1. Send Message API Wrappers

Send messages using our API wrappers. Less hassle and parameters for you to deal with.

PHP

include("SMSJuice-API/Message.inc.php");

//creates a new message object with your key and secret
$m = new Message("key", "secret");
$m->setSender("Restaurant"); //FROM address
$m->setRecipient(array("447000000000")); //TO address
$m->setMessage("Hello world"); //content to send
$result = $m->sendMessage(); //send the message

echo "<pre>";
print_r($result);
/** Contents of $result
Array
(
    [submit] => success
    [message_id] => 986ic4l7efd33g4s
)
 */

        

Java

        //creates a new message object with your key and secret
     Message m = new Message("mykey","mysecret");
     m.setSender("Dentist"); //FROM address
     m.setRecipient("447000000000"); //TO address
     m.setMessage("Hello, your appointment is due."); //content to send
     try {
            result = m.sendMessage();  //send the message
 } catch (MessageException e) {
     e.printStackTrace();
 }

        

2. Advanced API: Send directly through POST with JSON


To send a message to the API a JSON POST request is sent. The following parameters are required.

ParameterDescriptionPossible Values
keyaccount authentication key
secretaccount authentication secret
source_addresssender address for the message
destination_addressphone number of the recipient
messagethe message to send to the recipient
encodingthe encoding that the message is in 0 - SMSC Default Alphabet
1 - IA5 (CCITT T.50)/ASCII (ANSI X3.4)
2 - Octet unspecified (8-bit binary)
3 - Latin 1 (ISO-8859-1)
4 - Octet unspecified (8-bit binary)
5 - JIS (X 0208-1990)
6 - Cyrllic (ISO-8859-5)
7 - Latin/Hebrew (ISO-8859-8)
8 - UCS2 (ISO/IEC-10646)
schedulethe time you want the message to be sent
expirythe time that you want the message to expire
udhIf the type of message is binary then UDH marker is needed for provision of long SMS0 - normal length SMS
1 - long SMS(>160 characters)
receiptIndicator if a receipt is needed for the message.
The receipt will be sent to the callback URL you provide in settings
0 - no receipt.
1 -receipt required.
Default is no receipt

You can find our API functions on the menu on the right-hand side of this page. If you need assistance with connecting using our SMS RESTful API we will be happy to assist and review your requirements. Please send your requests to info@smsjuice.com.

Request Examples

Curl

        curl --include \
     --request POST \
     --header "Content-Type: application/json" \
     --data-binary '{
  "key": "roefvjbwibf",
  "secret": "EJEWY83G976GF3OWGF874G7F",
  "source_address": "118118",
  "destination_address": "447900385585",
  "udh": 0,
  "schedule": "2014-09-15 01:12:12",
  "expiry": "2014-09-17 01:12:12",
  "message": "Hey there, how are you today",
  "encoding": 1,
  "receipt": 1
}' \
     https://api.smsjuice.com/submit
        

Response Examples

Successful Response Example [HTTP RESPONSE 201 (ACCEPTED)]

        {"submit":"success","message_id":"nedi06rp289359256ks"}
        

Failed Response Example [HTTP RESPONSES : 400 (BAD_REQUEST), 401 (UNAUTHORIZED), 500 (INTERNAL_SERVER_ERROR)]

             {"submit":"failed","error":"invalid_credentials"}