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 two HTTP parameters - filterField and filterValue
Sanitize filterField - it has to be a value only with alphanumeric characters + numbers and underscores
Throw an exception if field name is not valid
Have a process variable for TableName
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
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:
Docs should mention (inside the usual headers) at least: