npm install hilink
var hilink = require('hilink');
hilink.setIp('192.168.1.x')
hilink.send( '88888888', 'Hello world', function( response ){
console.log( response );
});
Response:
{ response: 'OK' }
This method don't store a message.
hilink.sendAndDelete( '88888888', 'Hello world', function( sendResponse, deleteResponse ){
console.log( sendResponse );
console.log( deleteResponse );
});
Response:
{ response: 'OK' }
{ response: 'OK' }
hilink.listOutbox(function( response ){
console.log( JSON.stringify( response, null, 2 ) );
});
Response:
{
"response": {
"Count": [
"1"
],
"Messages": [
{
"Message": [
{
"Smstat": [
"3"
],
"Index": [
"20000"
],
"Phone": [
"88888888"
],
"Content": [
"Hello world"
],
"Date": [
"2014-04-03 05:03:26"
],
"Sca": [
""
],
"SaveType": [
"3"
],
"Priority": [
"4"
],
"SmsType": [
"1"
]
}
]
}
]
}
}
hilink.listInbox(function( response ){
console.log( JSON.stringify( response, null, 2 ) );
});
Response:
{
"response": {
"Count": [
"1"
],
"Messages": [
{
"Message": [
{
"Smstat": [
"0"
],
"Index": [
"20001"
],
"Phone": [
"+50588888888"
],
"Content": [
"Hello McNally"
],
"Date": [
"2014-03-03 17:49:16"
],
"Sca": [
""
],
"SaveType": [
"4"
],
"Priority": [
"0"
],
"SmsType": [
"1"
]
}
]
}
]
}
}
hilink.clearInbox();
hilink.clearOutbox();