Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Improved the language, grammar as well as the formatting to make the document more consistent/technical.


Info
titlePrerequisite Software 's Prerequisites

  Note:-

Below are mandatory prerequisite software's with mentioned versions onlyJAVA DEVELOPMENT KIT >> VERSION 1

The softwares mentioned below are MANDATORY prerequisites. Note that only the versions mentioned below are required.

  • Java Development Kit (version 1.8.0_65 & above                                MYSQL SERVER >> Version )
  • MySQL Server (version 5.5 or 5.6
    TOMCAT >> Version 7)
  • Apache Tomcat (version 7.0.64.0)



Panel

On this page:

Table of Contents
maxLevel3
minLevel3


How to Setup the Code Base

Step 1: Clone the Messagemessage-gateway source code into your local machine from the GitHub.

On Windows:

Code Block
languagebash
themeRDark
titleClone the Repository
$ git clone https://github.com/openMF/message-gateway.git

On Ubuntu:

Code Block
themeRDark
titleClone the Repository
$ sudo git clone https://github.com/openMF/message-gateway.git


Step 2: Open the source code directory (i.e cloned in on your local )machine. Now Git bash it, open Git Bash in this folder (through the right-click context menu).

On Windows:

On Ubuntu:

 Now move to Simple change your current directory to the message-gateway directory by entering the following command:

Code Block
themeRDark
$ cd message-gateway

How to

build

Build the Code Base

Step 1: Next, we need to generate the .war file. This can be achieved by using command the commands mentioned below:

On Windows:

Code Block
languagebash
themeRDark
$ gradlew clean build -Pprofile=deployable

On Ubuntu:

Code Block
languagebash
themeRDark
~/message-gateway$ sudo chmod 777 gradlew


~/message-gateway$ sudo ./gradlew clean build -Pprofile=deployable


Step 2:  Now create Create a database as with the name `messagegateway`.

Step 3: Now open Open the message-gateway source directory , and navigate to build>> build >> libs. Copy Copy the message-gateway-0.0.1.war file.

On Windows:

On Ubuntu:

Code Block
languagebash
themeRDark
~/message-gateway$ cd build

~/message-gateway/build$ cd libs


Step 4:  Next, navigate to Tomcat>>Navigate to Tomcat >> webapps and paste the message-gateway-0.0.1.war file within into this directory.

On Windows:

On Ubuntu:

Code Block
languagebash
themeRDark
~/message-gateway/build/libs$ sudo cp message-gateway-0.0.1.war /home/tomcat7/webapps/

How to Run

On Windows:

Go to Tomcat>>Navigate to Tomcat >> Bin directory and double click on startup.bat file to bat to start the application.

On Ubuntu:

Now navigate to the Tomcat >>>> bin folder and execute the following command to start the application.:

Code Block
languagebash
themeRDark
~/tomcat7/bin$ sudo sh startup.sh

How to

configure

Configure Message Gateway

Note
titleDownload Link

You can download the REST Client from this link:

http://download.wiztools.org/rest-client/archive/index.html


Open the REST Client and perform the following steps:

Step 1: When you open the REST client set the URL as: http://localhost:9191/message-gateway-0.0.1/tenants/ . HTTP Method HTTP method should be set to "POST". Finally, in the HTTP request body pass the following data:

Info
titleHTTP Request Body

{
"tenantId":"[Tenant_NAME]",
"description": "Some description"
}


NoteNOTE: Pass the appropriate "tenantId"


When we fire this request, "tenant app key" is generated as a response,this . This is shown in the screenshot below screenshot:


Step 2: In this step, set REST client URL as http://localhost:9191/message-gateway-0.0.1/smsbridges  . HTTP Method should be set to "POST". In the HTTP request body, pass the following data:

Info
titleHTTP Request Body

{
"phoneNo": "+12345678901",
"providerName": "Twilio SMS",
"providerDescription": "Twilio SMS Provider",
"providerKey":"Twilio",

"countryCode":"+xx",
"bridgeConfigurations": [
{
"configName":"Provider_Account_Id",
"configValue":"ACcb95cd9fb2e7d72f85c06aea6473f7iv"
},
{
"configName":"Provider_Auth_Token",
"configValue":"fed820a353def95f1m6fad077fef670e"
}
]
}


NoteNOTE: 1. phoneNo, providerName, configName, configValue, configName, configValue are to be set based on the individual subscription.


Pass these HTTP headers in the REST client:

HeaderValue
Fineract-Platform-TenantId{Pass the same Tenant ID that you have set in the previous step}
Fineract-Tenant-App-Key{Pass the same "Tenant app key" that is generated in the previous step}

Once headers are set, fire the HTTP request.


Step 3: In this step, set REST client URL as http://localhost:9191/message-gateway-0.0.1/sms/ HTTP Method  HTTP method should be "POST". In HTTP request body pass the following data.:

Info
titleHTTP Request Body

[{
"internalId":"55",
"mobileNumber":"+91xxxxxxxx80",
"message":"Hello from Staging",
"providerId":"2"
}]


NoteNOTE: (i)

  • Set the appropriate "mobileNumber" to
whom
  • the phone number you want to send the message to.
(ii)
  • Set
you
  • your required "message".
(iii)
  • Set "providerId"
that is
  • to the value generated in the previous step.

Pass the same HTTP headers that we passed in the last step.