Sleekplan Logo
we run on Sleekplan

Expose database data via HTTP

Expose database data via HTTP This template process receives an HTTP requests with a queries data from a Microsoft SQL database, transforms it into JSON format and returns to HTTP caller. Implementation: - Use HTTP trigger - Have three parameters - tableName, filterField and filterValue - Sanitize tableName and filterField - it has to be a value only with alphanumeric characters + numbers and underscores - Throw an exception if field name is not valid - Make sure to use DB parameters to safely execute query with fieldValue - The query to the database should just be a generic SELECT * FROM table WHERE filterName=filterValue - The reply should be a JSON string such as { "data": [ ..array of data.. ] } - The reply should be HTTP 200 status code - HTTP trigger should have API key authentication enabled Docs should mention (inside the usual headers) at least: - Authentication aspects - The ability to use API triggers if this process would be part of a larger API - How fields are sanitized for security - origin: [GitHub](https://github.com/FrendsPlatform/FrendsTemplates/issues/72)