From your code snippet _IWebHookService.BotWebHooks it looks like this is some kind of a library. Kite Connect clients doesn't need to use any such library or doesn't adhere to specific standards.
Kite Connect postbacks are simple POST requests to your given URL with json content as the POST body. You can use a simple HTTP handler and try to dump the request body.
To test your postback handler you can use any API testing tool like Postman or simply curl and make a post request with sample payload from https://kite.trade/docs/connect/v3/postbacks/
If postbacks never triggers this function then it means issue is in the way you attach URL to this handler. Try to do the testing as I mentioned before by manually make a POST request your handler.
Make sure to remove all account credentials from the code before posting.
Find the Code
[HttpPost("webhook")]
[Consumes("application/json")]
public async Task webhook()
{
try
{
using (StreamReader reader = new StreamReader(Request.Body, Encoding.UTF8))
{
var json = await reader.ReadToEndAsync();
try
{
var userInfo = await _IWebHookService.BotWebHooks(json);
Console.WriteLine(json);
}
catch (Exception e)
{
Console.WriteLine("Error: {0}", e.Message);
return BadRequest();
}
}
return Ok();
}
catch (DataValidationException ex)
{
return Ok();
}
}
URL we configured in console
_IWebHookService.BotWebHooks
it looks like this is some kind of a library. Kite Connect clients doesn't need to use any such library or doesn't adhere to specific standards.Kite Connect postbacks are simple POST requests to your given URL with json content as the POST body. You can use a simple HTTP handler and try to dump the request body.
To test your postback handler you can use any API testing tool like Postman or simply curl and make a post request with sample payload from https://kite.trade/docs/connect/v3/postbacks/
Any thing i missed in code apart?