I deployed both ngrok and Google Cloud Function. Both postback URLs --https://882b2972.ngrok.io and https://asia-east2-nodejs-app01.cloudfunctions.net/webhook-receiver tried in the postback URL of the testing APP on kite. But neither 127.0.0.1:4040 or the Google cloud function logs showed any request when I punched in regular orders after market hours. typically i should get a order rejected updated in the log.
You will receive an order update only for the client ID you specified in the app details page. Your ngrok URL seems to be dead. And the cloud functions URL is not used in any of your apps.
I configure following Google Function URL as my postback to client ID MW5790 I get an access token for same Client ID and issue a NRML order on NIFTY FUT SHORT after market hours. The order gets placed successfully. but the order status turns into rejected.
In the google function this is the trigger
exports.broadcastUpdate = (req, res) => { let payload = req.body; console.log('got incoming broadcast update from -', req.connection.remoteAddress); console.log('Request Body -',payload); //res.status(200).send({ok: true}); res.status(200).send(payload ||'Source IP-'|| req.connection.remoteAddress ); };
Multiple times curl command is issued but nothing gets logged on my Google logs.
Next
1. Configure simple web server on my laptop running on 3000 2. Point ngrok and verify my https://45f49918.ngrok.io --> hits the web server on browser , verified 3. Updated Postback URL to https://45f49918.ngrok.io 4. My sample.js file has following standard logic for listenting to order_updates ticker.on("order_update",order_details); function order_details(data) { console.log("Entered Order_details"); console.log("Order_details", data); } 5. Update same access token .api_key in sample.js file as used in curl command 6. . issue curl command to place NRML order after market hours. 7. The Positions, ticks data prints on console but the Order Update to rejected status doesn't print at all .. tried issuing same command multiple times
Your ngrok URL seems to be dead.
And the cloud functions URL is not used in any of your apps.
Can you clarify how you collect the logs?
I get an access token for same Client ID and issue a NRML order on NIFTY FUT SHORT after market hours. The order gets placed successfully.
but the order status turns into rejected.
In the google function this is the trigger
exports.broadcastUpdate = (req, res) => {
let payload = req.body;
console.log('got incoming broadcast update from -', req.connection.remoteAddress);
console.log('Request Body -',payload);
//res.status(200).send({ok: true});
res.status(200).send(payload ||'Source IP-'|| req.connection.remoteAddress
);
};
Multiple times curl command is issued but nothing gets logged on my Google logs.
Next
1. Configure simple web server on my laptop running on 3000
2. Point ngrok and verify my https://45f49918.ngrok.io --> hits the web server on browser , verified
3. Updated Postback URL to https://45f49918.ngrok.io
4. My sample.js file has following standard logic for listenting to order_updates
ticker.on("order_update",order_details);
function order_details(data) {
console.log("Entered Order_details");
console.log("Order_details", data);
}
5. Update same access token .api_key in sample.js file as used in curl command
6. . issue curl command to place NRML order after market hours.
7. The Positions, ticks data prints on console but the Order Update to rejected status doesn't print at all .. tried issuing same command multiple times