SMS-OTP Integration for Nearby Shops

In this article we will learn how to enable SMS-OTP for your app.

For Managed Setup

SMS-OTP Integration comes out of the box with our hosting service. Therefore you dont have to do anything in order to setup SMS-OTP.

For Self-Hosted Setup

SMS-OTP integration is required to enable your app to send SMS or OTP. Sending SMS is needed for various reasons. It is required to verify the phone number at the time of sign-up. It is also required to send the user live status updates for the order. As an example a user can receive SMS updates when his order is packed and out for delivery.

Signing up using verified phone numbers has become a standard practice these days. This helps us to ensure we have legitimate and verified users on your app platform and therefore it helps in building more trust.

To integrate and start SMS-OTP service in your app currently we use msg91 platform. Dont worry msg91 is not the only way to enable SMS in your app. We will soon add various other integrations with various other SMS services.

To integrate your app with msg91 SMS service is a very simple process. You just need to sign-up on msg91.com and start your SMS subscription by making a payment and get your msg91 api key.

If you have installed your Instance using Docker then follow these steps.

Enter and Get inside your container.

                     Commands
                  

    docker start nbs_api_container

    OR

    docker-compose start
    (please ensure that you are inside the directory where docker-compose.yml resides)



    docker exec -it nbs_api_container bash

    cd ~/nearbyshops/data

    sudo nano api_config.properties

    (Exit container using Ctrl + C or Ctrl + D)
                
                

Update the api_config.properties file with msg91 api keys and then save it using Ctrl + X
Dont forget to restart the server after making changes to the api_config.properties file.

                    Commands : Restart Container
                  

    docker stop nbs_api_container

    docker start nbs_api_container

    OR

    docker-compose restart
    (please ensure that you are inside the directory where docker-compose.yml resides)

                
                

If you have done a manual installation then follow these steps.

                     Code
                  
    cd ~/nearbyshops
    sudo nano api_config.properties
                    
                  

Then you need to update the msg91 API key in the api_config.properties file which is available with the api jar file. After you update the msg91 api key in the api_config.properties file. Just restart the server and you are done. The SMS-OTP facility should start now !

                     Code
                  
                      sudo systemctl restart nearbyshopsapi
                  
                
OR
                     Code
                  
                      shutdown -r now
                  
                

If you face any difficulty feel free to get in touch with us on our forum !