Hi, I wrote this custom API_Action. This is OPEN api, so I can reach it throu POSTMAN without JWT.
Ho can I check JWT token instead (ANM 2021)?
public class GetTableController : ApiController {
[HttpGet]
public IActionResult Get([FromBody] Newtonsoft.Json.Linq.JObject data) {
string sSQL = "";
string columns = INOE(data["Columns"])?"*":sobj(data["Columns"]);
string table = INOE(data["Table"])?"":sobj(data["Table"]);
string where = INOE(data["Where"])?"TRUE":sobj(data["Where"]);
try {
sSQL = $"SELECT {columns} FROM `{table}` WHERE {where};";
var rs = ExecuteRows(sSQL);
return Json(rs); // Get the value from route
} catch (Exception e) {
myLogger($"Error: {e}");
myLogger($"Last SQL: {sSQL}");
return Ok(new {success=false, message=e.ToString()});
}
}
}