REST API - Get
This function block is designed to retrieve data from a specified REST API server using a GET request. It allows users to specify a server address and an optional data ID to fetch corresponding data.
π₯ Inputs
Enable Condition
A boolean input that enables the API call when set to true.
Server Address
A string input to specify the endpoint of the REST API from which data will be retrieved.
Data ID
Optional string input to specify a key from the API response to extract specific data.
π€ Outputs
Status Code
This output shows the HTTP status code returned by the server after the GET request.
Error
This output gives any error message received from the server, if the request is unsuccessful.
Response
This output contains the data returned by the server, which could be either raw text or JSON data corresponding to the specified Data ID.
πΉοΈ Controls
Timeout (s)
A text box where the user can specify the timeout duration for the server request in seconds.
π¨ Features
Conditional Execution
This block runs the API call only if the enable condition is set, ensuring efficiency and control over the request process.
Dynamic Response Handling
Users can receive both raw responses and specific data items from the JSON response based on the provided data ID.
π Usage Instructions
Set Enable Condition: Connect a boolean value to enable the execution of the request.
Enter Server Address: Provide the REST API endpoint URL in the
Server Address
input.Optional Data ID: If you wish to retrieve a specific piece of data from the response, enter the corresponding key in the
Data ID
input.Set Timeout: Specify the timeout duration to wait for the server response in seconds.
Evaluate: Run the block to execute the GET request and retrieve the data.
π Evaluation
Upon evaluation, this function block will perform the specified GET request and return the status code, any error message, and the response content.
π‘ Tips and Tricks
π οΈ Troubleshooting
Last updated