Skip to content

melroselabs/mlrestsmpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

mlrestsmpp

REST-SMPP bridge from Melrose Labs that can be deployed on AWS API Gateway and AWS Lambda

Use REST calls to submit SMS text messages using an SMPP account. For use with any SMS gateway / aggregator / SMPP provider and not only Melrose Labs Tyr SMS Gateway.

Deploy in your own AWS API Gateway/Lambda instance or use existing Melrose Labs endpoint (no account required):

https://api.melroselabs.com/restsmpp/sms/

API Gateway calls lambda function lambda_function.py to process REST call JSON payload and perform SMPP session. Multiple destination mobile number can be specified. Initial code in repository and will be updated with more capabilities and parameters in due course.

REST API Usage

curl https://api.melroselabs.com/restsmpp/sms/ \
	--header 'Content-Type: application/json' \
	--data-raw '{"smpp_account_config":{"host":"HOST","port":2775,"system_id":"SYSTEMID","password":"PASSWORD"},"message":{"source_addr":"MelroseLabs","short_message":{"text":"Melrose Labs engineer great communication services."}},"destinations":["447892000000","44","447892000002","44","44","447892000003"]}'

JSON Request

{
  "smpp_account_config": {
    "host": "HOST",
    "port": 2775,
    "system_id": "SYSTEMID",
    "password": "PASSWORD"
  },
  "message": {
    "source_addr": "MelroseLabs",
    "short_message": {
      "text": "Melrose Labs engineer great communication services."
    }
  },
  "destinations": [
    "447892000000",
    "44",
    "447892000002",
    "44",
    "44",
    "447892000003"
  ]
}

Response

Successful (with missing message IDs where rejected):

{"transactionID": "39aca5bf-2c5f-4886-bb1f-95ffe4398257", "messageID": ["10a2", "", "10a3", "", "", "10a4"]}

Can't connect to host/port:

{"error": "Unable to connect"}

System ID / password / system type incorrect:

{"error": "Unable to bind"}