Calling Homeassistance Apis using Nodejs

I struggled a lot to send lock/unlock command from my mobile app towards homeassitant apis, later I found it to be only one line of code and voila.

For anyone interested in knowing how to call homeassistant api’s using nodejs.

var request = require('request');
request.post('http://localhost:8123/api/services/lock/unlock',{"entity_id": "lock.locked_2"}, function(err, body) {
    if(err) {
        console.log(err.message);
    } else {
        console.log(body);
    }
})

-Amino