The REST function allows users and the bot to communicate and interact with online applications through a REST endpoint and to store the results for later use.
Here you can define the inputs which you can then use in the path, headers and body by surrounding them with square brackets (This is an [Input]).
Method
You can choose all of the possible REST methods, GET to get information, POST to send information (with a JSON body), PUT and PATCH to edit information and DELETE to delete information.
API Path
Here you can put the full function path as provided by the endpoint host.
The header contains metadata about your request. For example the content type or authentication information.
Body
The body is only available for the POST, PUT and PATCH methods. Here you need to provide a JSON in the correct format as provided by the endpoint host. The body accepts FormData or raw JSON data.
Outputs
As a result of making any rest call, the endpoint will respond with a JSON, which can contain information about your call, for example if it was successful, and any information you requested. You can define the path of any value you want to extract from the JSON by giving the consecutive element names separated by dots in the object path. If you need to address a list within the JSON (square brackets) you can do this by giving the index of the element you want, starting at zero.
Within the Blits platform it is possible to make use of reverse indexing (-1 will give you the last element of the list, -2 will give you the second to last element in the list and so on)
Show Output
With the show output function you can show the result of your REST call. The default values will be used for the variables. If you do not define any outputs it will show you the full JSON output. If you do define outputs, it will show your output values.