To use a header value informed in an API request through a connector, you must inform the name of the header key and use the variable $headerParam.<header key> in your instruction.
The example below is a request received by the API Platform and which will be sent to the connector:
In this request, there is a header with the key productId.
To obtain the value of this header, $headerParam.productId must be used as follows:
(note that the example shows the variable of a SQL connector being used)
And the example below shows the execution of the instruction by the connector:
NOTETo enter the value as a string, use single quotes:
'$headerParam.productId'In the conversion, it will look like this:
'9c69483b-2953-3e88-a87a-4ad24416d87c'
To use a path param value informed in an API request through a connector, you must inform the path param key name and use the variable $pathParam.<path param key> in your instruction.
As in the previous subsection, the example below is of a request received by the API Platform and which will be sent to a connector:
The request above has a path param with the key /products/{productId}.
To obtain the path param value, $pathParam.productId must be used as follows:
(example for a SQL connector)
In the execution of the instruction by the connector, we will have:
NOTETo enter the value as a string, use single quotes:
'$pathParam.productId'In the conversion, it will look like this:
'560'
To use a query param value informed in an API request through a connector, you must enter the query param key name and use the variable $queryParam.<query param key>.
Example of a request to a connector:
In this request, there is a query param with the key productName.
To obtain its value, use $queryParam.productName as follows:
(example of a variable being used in a SQL connector)
In the execution of the instruction by the connector, we will have:
To include into a database values passed in a request body, you must inform the body keys in the instructions to the connector and use the variable $body.<body key>, as in the example below.
Request received by the API Platform and which will be sent to a connector:
In the request above, we have a body with the keys productName and productPrice.
You can insert their values into the database as follows:
(example of a variable being used in a SQL connector)
In the execution of the instruction by the connector, we will have:
We use cookies to enhance your experience on our site. By continuing to browse, you agree to our use of cookies.Learn more