HTTP Requests
Overview
This service is used to make HTTP Requests to third-party API's and to consume the Response into a BOS Database. Request Headers and Bodies can be fixed or generated from the database using SQL procedures.
Fields
Description - Enter a description that describes the function of the HTTP Request.
Method - Select from GET, PUT, POST, DELETE or PATCH
URL - The URL (endpoint) of the request.
Request Header - Add fixed headers in JSON format.
Request Header SQL - Used to select data from the DB for the Request Header - the SQL must return a REQUESTHEADER (Blob/Text) field in JSON format.
Request Body - Add a fixed body in JSON format.
Request Body SQL - Used to select data from the DB for the Request Body - the SQL must return a REQUESTBODY (Blob/Text) field, which contains a JSON object as well as a RECORDID (Integer) field which returns the Primary Key of the record which is being updated.
Response Header - Displays the raw Response Headers
Response Body - Displays the Response Body
Response SQL - Used to update the DB - the parameter names must match the JSON Response Keys (Note the matching names must be case sensitive - Data <> DATA). A RECORDID (Integer) parameter is used to assign the primary key of the record to be updated. When assigning JSON Keys to parameters, you need to encapsulate them in double-quotes - eg. and :"Message.Severity" = 0
Connection String - Used to connect to the Firebird 3 BOS DB. Right-click and select Edit Connection String.
Request
The Request procedure executes the call and updates the Response to a variable where it can be accessed by the Response procedure.
The Request Header/Body SQL fields take precedence over the fixed Request Header/Body fields.
When the Request Body SQL is used, the Request is executed for each record that is returned.
Click the Template button to generate example code for the selected Tab.
Response
The response Body must be a JSON object. The parameters in the Response SQL must match the Key values in the JSON object.
When assigning JSON Keys to parameters in your SQL, you need to encapsulate them in double-quotes - eg. and :"Message.Severity" = 0
If a JSON object is returned, the square brackets [ ] are added to convert it into a JSON Array. The Response SQL is executed once for each JSON object in the Array.
Functionality is provided to enter a JSON keyname and to get the value from the JSON Object. Make sure there is only one object in the Response for testing. This is useful for confirming a response before assigning it to your SQL.
Menu
Edit & Test - This opens a form where you can edit fields and test the HTTP request.
Edit Schedule - Edits the interval at which the HTTP Request will be executed.
Edit Connection String - Enter the connection string to connect to a BOS DB