Notify4Me Enterprise API v0.1

AccessToken

AccessToken is the ONLY unique key for API access notify4me enterprise service,when you invoke the API interface, please put the correct AccessToken in the http header (name: access-token). one of the example of AccessToken as below: "eyJ0eXAiOiJKV1QiLCJhbGxiOiJIUzI1NiJ9.eyJ1aWQiOiI1ODhlZDc2ZDg7utyuMzcyNjBiYWM3MzAiLCJleHAiOjE2NTE0NjY2Mjg5NjZ9.kfGpBEwj3pAMFy-ZvBozyYyxQs5RzKWdNeQC2g_XyDw"

You can get your own AccessToken in your "Edit profile" page(readable only).If the page does not show the "Enterprise API Setting" section, please contact us through mail: notify4me@entratacommunications.com. We will upgrade your account to enterprise account for free.

Send SMS

You can send the sms through notify4me API interface.

API Description

HTTP Method: POST

http://api.notify4me.com.au/ent/v0.1/send

request http header must contain access-token info, and please set the http Content-Type as application/json

Path : /ent/v0.1/send
HTTP Method : POST
Request Headers : {
	   Content-Type : application/json,
	   access-token : ${AccessToken}
}
...
//Note: PLEASE set HTTP Content-Type as application/json in the header when you do the http post request!
Post parameter description

send post data in Json format: please note we only support AUST wide sms, so the prefix is alwasy be 61 at this stage.

{
    "message": "Dear {First Name}, happy new year!", // message body
	"numbers": [
    	{"prefix": "61", "mobile": "0431636484", "firstName": "John", "lastName": "Woo"},
	 	{"prefix": "61", "mobile": "0431636485", "firstName": "Mary", "lastName": "Woo"}
	], // phone numbers
	"schedule": {
		"type": 1, // 1=send now 2=send at schedule time
		"utc": 0 // if type == 2, then "utc" should be schedule time
		         // [the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC]
	}
}
Return

If success,return result in Json format:

{
  "success": true,
  "bill": {
    "total": 50, // total charge
    "detail": {
      "61": { 
        "mobilePrefix": "61",
        "phoneCnt": 2, // phone number count
        "smsCnt": 2, // sms count(base on 160 char)
        "rate": 25, // charge per sms, unit:0.1 cent
        "total": 50 // total charge (unit: 0.1 cent) of this mobile prefix  
      }
    },
    "seq": "59086ba935fea7088b5975a8" // sequence of this post
  }
}

If fail,return as blew in Json

{
  "code" :  error-code 
  "msg"  : "error message here"
}

1000 > code > 100       user input error
       = 101  "msg": "your credit is not sufficient to send the sms" 
0 <code < 100           system level error
       = 1    		system is not available 
code > 1000             waring
       = 1001 your sms is in the sending transmission queue. 

example:
{
  "code" :  101 
  "msg"  : "your credit is not sufficient to send the sms"
}

PLEASE be carefully about the code 1001.
When our notify4me sending sms system is in some difficuty, we will put the sending request in a transmission queue. We will send all the request in the transmission queue once the system is back on line.
So you may consider this code 1001 is successfull in your situation.

Two-Way SMS receive

notify4me provides the callback interface to allow the enterprise user to get the reply sms

CallBack URL(only supoort http this stage) MUST provide these facility to accommodate the reply sms receiving:

Support HTTP Method: POST

Post parameter description

we will post the reply sms to the callback url in Json format:

{
    "prefix": "61",
    "mobile": "0431636484",
    "message": "hi this is a test, good!",
    "receiveAt": 1492161138000
}
Return description

If success,please return Json format:

{
  "success": true,
}

If fail,please return Json format:

{
  "success" :  false, 
  "message"  : "error message here"
}