Handle MO-SMS

Upon receive MO SMS, MoceanSMS API Server will identify where it should relay based on keyword (first word in MO SMS) and relay it.

After relaying MO SMS, MoceanSMS API Server is expecting a respond with “HTTP OK” (Status 200) or it will keep on retrying until it expired(36 hours).

HTTP Method Used

POST - MoceanSMS API Server will act as a HTTP client to issue a HTTP POST to your MO callback url. Data will be stuffed inside the HTTP Message Body.

Parameters

The information of the SMS will be stuffed inside the HTTP body.

Parameter Name

Data Format

Descriptions

mocean-from

number

Phone number of the original SMS sender.

mocean-to

number

Phone number of the original SMS recipient, normally the short code (e.g. 63001).

mocean-time

datetime

The datetime when the message is received by SMS gateway. (Format YYYY-MM-DD hh:mm:ss).

mocean-text

string

Content of the SMS.

mocean-keyword

string

Keyword used for the MO.

mocean-coding

number

Message type of SMS. 1 for text/Mobile telephony character set and 3 for Unicode SMS.

Example Helper

// This only support 7-bit and 8-bit message type. For unicode messages, you are required to download our library

// Get data from POST request
$data = array(
'mocean-from' => $_POST['mocean-from'],
'mocean-to' => $_POST['mocean-to'],
'mocean-keyword' => $_POST['mocean-keyword'],
'mocean-text' => $_POST['mocean-text'],
'mocean-coding' => $_POST['mocean-coding'],
'mocean-time' => $_POST['mocean-time']
);

// Print out data
echo "mocean-from => $data['mocean-from'] \n";
echo "mocean-to => $data['mocean-to'] \n";
echo "mocean-keyword => $data['mocean-keyword'] \n";
echo "mocean-text => $data['mocean-text'] \n";
echo "mocean-coding => $data['mocean-coding'] \n";
echo "mocean-time => $data['mocean-time'] \n";