# tRESTRequest

Receives GET/POST/PUT/PATCH/DELETE requests from the clients on the server end.

tRESTRequest accepts the HTTP and/or HTTPS requests from the clients and supports GET, POST, PUT, PATCH and DELETE HTTP methods.

Information noteNote:

To enable the HTTPS support, you have to generate a keystore and add some HTTPS security configuration properties in the *org.ops4j.pax.web.cfg* file of your Runtime container before deploying the service on it. For more information, see [HTTP configuration](https://help.qlik.com/talend/r/en-US/8.0/esb-container-administration-guide/http-configuration).

## tRESTRequest Standard properties

These properties are used to configure tRESTRequest running in the Standard Job framework.

The Standard tRESTRequest component belongs to the ESB family.

*This component is relevant only when used with one of the Talend solutions with ESB, as it should be used with the Service Repository node and the Data Service creation related wizard(s).*

## Basic settings

| Properties | Description |
| --- | --- |
| API Definition / Definition | Click [...] to browse to the API definition file to<br>initialize your component endpoint, API mappings and documentation from your<br>API definition.<br><br>The output flow values in the API mapping are used in generated Java code,<br>therefore they need to be camel case compliant. Output flow values are taken or<br>computed from the API definition with these priorities:<br><br><ul> <li>operationId, which is the best practice. Even though operationId is not                           a mandatory field in OAS specification, it is recommended to use it at                           API design time.</li> <li>summary (Name in <span>Talend API Designer</span>), which will be converted and truncated in 120 characters to supported                           format.</li> <li>operation method and path, which will be computed with the same                           constraint as summary.</li> </ul> |
| REST<br>Endpoint | Fill this field with the service path where the REST service is accessible. For Data Service deployments in Talend Runtime Container (ESB Runtime), do not include hostname:port in this field.<br><br>The default endpoint value for a new component is "/restservice/v1". This value is meant as an example. Replace it with your own path value. You can define the endpoint path using context variables. |
| REST API<br>Mapping | Click the [+] button beneath the<br>mapping table to add lines to specify HTTP request:<br><br><br>Output<br>Flow: Click the [...] button to specify the name of an<br>output flow and set the schema for that output flow in the dialog box<br>afterwards.<br><br>The schema is not<br>mandatory, so if you do not need to pass additional parameters to the<br>tRESTRequest<br>component, you can leave the schema empty. However, you will have to<br>populate the schema if you have URI Path parameters set in the<br>URI Pattern<br>field or if you need to add optional request parameters such as URI<br>Query, HTTP Header or Form parameters, to the URI specified in the<br>REST Endpoint<br>field.<br><br>Add a schema with the name<br>*body* to get the request body<br>of POST and PUT methods. It supports Document, String, and Byte types.<br><br>If you specify URI parameters in the output flow schema, you<br>might need to define what type of parameter it is in the Comment field of the<br>schema. By default, if you leave the Comment field empty, the parameter is<br>considered as a Path parameter. Below is a list of supported Comment values:<br><br><ul> <li> <p>empty or <em>path</em> corresponds to the default                                        @PathParam, </p> </li> <li> <p> <em>query</em> corresponds to @QueryParam,                                    </p> </li> <li> <p> <em>form</em> corresponds to @FormParam, </p> </li> <li> <p> <em>header</em> corresponds to                                        @HeaderParam.</p> </li> <li> <p> <em>matrix</em> corresponds to                                        @MatrixParam.</p> </li> <li> <p> <em>multipart</em> corresponds to the CXF                                        specific @Multipart, representing the request body. It can                                        be used only with POST and PUT HTTP methods. </p> <div>For example, add a column <em>number</em> and enter <em>query</em> in the                                 <span>Comment</span> field to get the number parameter in                              the request. Add a column with the same name as the header and enter                                 <em>header</em> in the <span>Comment</span> field to fetch                              the HTTP header.                                 <img src="https://help.qlik.com/talend/en-US/components/8.0/Resources/images/trestrequest_api_schema.png" alt=""> </div> <p>You can not use API operation names with special characters, for                              example <span>-</span> or <span>$</span> in the                                 <span>Column</span> column as these operation names will                              be used as Java identifiers in generated code. </p> <p>If you have installed the R2022-02 <span>Talend Studio</span> Monthly update or a later one delivered by <span>Talend</span>, you can use any character for parameter names by adding                                 <span>(param-name)</span> behind parameter type in the                                 <span>Comment</span> column. This mechanism avoids                              failures when importing APIs from the <span>Talend API Designer</span> in a data service. If special characters are used in the API                              designer, they are replaced in the <span>Column</span>                              column to be Java compliant and real parameter name is added to the                                 <span>Comment</span> column. For more information about                                 <span>Talend Studio</span> Monthly update, check with your administrator. </p> <img src="https://help.qlik.com/talend/en-US/components/8.0/Resources/images/trestrequest_api_schema1.png" alt=""> </li> </ul><br><br>Information noteNote: We recommend you to set the<br>default values of your optional parameters (Header, Query, Form). To<br>do so, fill in the Default columns of the schema.<br><br><br>HTTP Verb: Select a HTTP method<br>(GET/POST/PUT/PATCH/DELETE/OPTIONS/HEAD) from the list.<br><br><br>URI pattern: Fill this field with<br>REST-ful URIs that describe the resource.<br><br><br>Consumes: Select the format type of the<br>consume content that the component will use from XML<br>or JSON, XML, JSON, Form, Multipart and<br>Any in the list when the HTTP method<br>is POST, PUT, or PATCH.<br><br><br>Produces: When the HTTP<br>method is GET, POST, PUT, PATCH, or DELETE, select the format type of<br>the produce content that the component will use from XML or JSON, XML, JSON, HTML and Any, or select<br>&lt;oneway&gt; in the list to accept one way<br>requests.<br><br><br>Streaming: Select this<br>check box to stream the response data by chunks so that the large<br>volumes of data can be processed efficiently. |
| Security | Select this check box to enable the security option for the<br>current service. Select the security scheme from:<br><br><ul> <li> <span>Basic HTTP</span>: The simplest technique for enforcing                        access controls to web resources using standard fields in the HTTP                        header.</li> <li> <span>JWT Bearer Token</span>: The open and standardized method                        for storing and exchanging data in JSON format. </li> <li> <span>SAML Token</span>: An XML-based, open-standard data format                        for exchanging authentication and authorization data between an identity                        provider and a service provider.</li> <li> <span>Open ID Connect</span>: An extension for OAuth2 which allows                        Clients to verify the identity of the End-User based on the authentication                        performed by an Authorization Server, as well as to obtain basic profile                        information about the End-User in an interoperable and REST-like manner. For                        more information, see <a href="https://help.qlik.com/talend/r/en-US/8.0/esb-infra-services-configuration-guide/talend-identity-and-access-management" target="_blank">Talend Identity and Access                           Management</a> and <a href="https://help.qlik.com/talend/r/en-US/8.0/administration-center-user-guide/managing-esb-resources-and-authorizations" target="_blank">Managing ESB Resources and                           authorizations</a>.</li> </ul> |
| JWT configuration | JWT configuration options appear when JWT Bearer Token<br>is selected in the Security list. In the<br>Keystore Type list, select:<br><br><ul> <li> <span>Java Keystore (*.jks)</span> to provide a local Java                           keystore file,</li> <li> <span>PKCS12 Keystore (*.p12, *.pfx)</span> to provide a local                           keystore file in PKCS12 format,</li> <li> <span>JSON Web Key Sets (JWKS)</span> to provide the URL of                           the online key sets.</li> </ul><br><br>For the Java Keystore (\*.jks) or PKCS12<br>Keystore (\*.p12, \*.pfx) keystore type, you need to enter the<br>location of the keystore file and the associated password in the<br>Keystore File and Keystore<br>Password fields respectively. You can also set the<br>Keystore Alias and Audience as<br>needed.<br><br>For the JSON Web Key Sets (JWKS) keystore type, you need<br>to specify the URL of the online key sets in the JWKS<br>URL field. You can also set the Audience<br>as needed. |
| Use Service Locator | Select this check box to enable the Service Locator. It maintains the availability of the service to help meet demands and service<br>level agreements (SLAs). Specify the Service namespace and the Service name in the<br>corresponding fields. |
| Use Service<br>Activity Monitor | Select this check box to enable the Service Activity<br>Monitor. It captures events and stores this information to facilitate<br>in-depth analysis of service activity and track-and-trace of messages<br>throughout a business transaction. This can be used to analyze service<br>response times, identify traffic patterns, perform root cause analysis and<br>more. |
| Use<br>Authorization | Select this check box to enable authorized call. This option<br>appears when SAML Token is selected in<br>the Security list.<br><br>For more information about the management of user roles and<br>rights, see [Managing ESB Resources and<br>authorizations](https://help.qlik.com/talend/r/en-US/8.0/administration-center-user-guide/managing-esb-resources-and-authorizations) and [Talend Identity and Access<br>Management](https://help.qlik.com/talend/r/en-US/8.0/esb-infra-services-configuration-guide/talend-identity-and-access-management). |
| Use Business<br>Correlation | Select this check<br>box to enable the correlation option so that chained service calls will<br>be grouped under the same correlation ID. tRESTRequest will extract the<br>correlation ID from the request header and store it in the component<br>variable for further use in the flow.<br><br>If this option is not enabled on the client side, a<br>correlation ID will be generated automatically in tRESTRequest. |

## Advanced settings

| Properties | Description |
| --- | --- |
| Log<br>messages | Select this check box to log the message exchange<br>between the service provider and the consumer. |
| Expose OpenAPI documentation | Select this checkbox to activate documentation of an API implementation.<br>When this option is enabled, deployed REST service offers the following endpoints<br>to access API documentation:<br><br><ul> <li><span>http://host:port/[component_endpoint]/openapi.json</span>: API                        documentation as raw text (JSON file as OpenAPI 3.0.1 format).</li> <li><span>http://host:port/[component_endpoint]/api-docs</span>: A UI with                        API documentation and opportunity to test API operations.</li> </ul><br><br>If this option is enabled and the REST service is built as a Microservice,<br>you can activate or deactivated API documentation by adding the<br>exposeOpenApi=[true/false] parameter in the<br>application.properties configuration file inside the<br>Microservice JAR, or using the -DexposeOpenApi=[true/false]<br>parameter in the command when running the Microservice.<br><br>Information noteNote:<br><br>This option is available only if you have installed the R2025-10 Talend Studio Monthly update or a later one delivered by Talend. For more information, check with your administrator.<br><br>To use this feature in Talend Runtime, you need to install Talend Runtime 8.0.1-R2025-10 patch or a later one and execute command<br>feature:install cxf-rs-description-openapi-v3 inside<br>the Runtime console. For more information, see [Starting Talend Runtime with<br>console](https://help.qlik.com/talend/en-US/esb-container-administration-guide/8.0/starting-talend-runtime-with-console) and [Feature Scope](https://help.qlik.com/talend/en-US/esb-container-administration-guide/8.0/feature-scope). |
| Wrap JSON<br>Request | Select this check box to wrap the JSON request with a<br>*root* element. |
| Attributes to Elements | Select this check box to exclude @ in the response<br>attribute. |
| Convert<br>JSON values to String in response | Select this check box to convert the JSON values to<br>string format in the response. |
| JAXRS properties | This option appears when JWT Bearer Token is selected<br>in the Security list in the Basic<br>settings tab. Click [+] to add as many<br>properties as needed to the table. In the Property Name<br>field, you can either select the property from the drop-down list, or enter a<br>property name that is not available in the list. Enter the value of the property<br>in the Property Value field. For more information on the<br>JAXRS properties, see the [Apache CXF documentation](https://cxf.apache.org/docs/jax-rs-jose.html#JAXRSJOSE-Configuration). |
| Service Locator Customer Properties | This option appears when Use Service Locator<br>is enabled in the Basic<br>settings tab. Click [+] to<br>add as many properties as needed to the table. Enter the name and the value of<br>each property in the Property Name field<br>and the Property Value field respectively<br>to identify the service. |
| Service<br>Activity Customer Properties | This option appears when Use Service Activity Monitor is enabled in<br>the Basic settings<br>tab. Click [+] to<br>add as many properties as needed to the table. Enter the name and the value<br>of each property in the Property<br>Name field and the Property Value field respectively to<br>identify the service. |
| tStatCatcher<br>Statistics | Select this check<br>box to gather the Job processing metadata at a Job level as well as at<br>each component level. |

## Global Variables

| Variables | Description |
| --- | --- |
| Global<br>Variables | NB\_LINE:<br>the number of rows processed. This is an After variable and it returns an integer.<br><br><br>URI: the URI of the REST request. This is a Flow variable and it<br>returns a string.<br><br><br>URI\_BASE: the base URI of the REST request. This is a<br>Flow variable and it returns a string.<br><br><br>URI\_ABSOLUTE: the absolute URI of the<br>REST request. This is a Flow variable and it returns a string.<br><br><br>HTTP\_METHOD: the<br>http method. This is a Flow variable and it returns a string.<br><br><br>ATTACHMENT\_HEADERS: the attachment headers from the REST request. This<br>is a Flow variable and it returns a list of attachment header values.<br><br><br>ATTACHMENT\_FILENAMES: the attachment filenames from the REST request.<br>This is a Flow variable and it returns all attachment filenames.<br><br><br>PRINCIPAL\_NAME:<br>the principal name of the REST request. This is a Flow variable and it returns a<br>string.<br><br><br>CORRELATION\_ID:<br>the correlation ID by which chained service calls will be grouped. This is a Flow<br>variable and it returns a string.<br><br><br>ERROR\_MESSAGE: the error message generated by the<br>component when an error occurs. This is an After variable and it returns a string. This<br>variable functions only if the Die on error checkbox is<br>cleared, if the component has this checkbox.<br><br>A Flow variable functions during the execution of a component<br>while an After variable functions after the execution of the component.<br><br>To fill up a field or expression with a variable, press Ctrl+Space to access the variable list and choose the variable to use from<br>it.<br><br>For more information about variables, see [Using contexts and variables](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/contexts-and-variables). |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage<br>rule** | This component covers the possibility that a Talend Job can be wrapped as a service, with the ability to input<br>a request to a service into a Job and return the Job result as a service<br>response.<br><br>The tRESTRequest component should be used<br>with the tRESTResponse component to provide a Job result as a<br>response, in case of a request-response communication style. |
| Limitation | Using context variables for dynamic endpoint or Service Locator namespace works in Talend Studio only. It is not supported in Talend Runtime. |

**Related concepts**

* [Using a REST service to accept HTTP POST requests and send responses](https://help.qlik.com/talend/en-US/components/8.0/esb-rest/trestrequest-trestclient-tlogrow-using-rest-service-to-accept-http-post-requests-and-send-responses-standard-component-esb-this)
* [Using a REST service to accept HTTP POST requests in an HTML form](https://help.qlik.com/talend/en-US/components/8.0/esb-rest/trestrequest-trestresponse-txmlmap-tjavarow-using-rest-service-to-accept-http-post-requests-in-html-form-standard-component-esb-this)
* [Using a REST service to accept HTTP POST requests](https://help.qlik.com/talend/en-US/components/8.0/esb-rest/use-rest-accept-http-post)
* [Using a REST service to accept HTTP GET requests and send responses](https://help.qlik.com/talend/en-US/components/8.0/esb-rest/trestrequest-trestresponse-txmlmap-trestresponse-txmlmap-using-rest-service-to-accept-http-get-requests-and-send-responses-standard-component-esb-this)
* [Using URI Query parameters to explore the data of a database](https://help.qlik.com/talend/en-US/components/8.0/esb-rest/trestrequest-trestresponse-tfixedflowinput-tmysqloutput-using-uri-query-parameters-to-explore-data-of-database-standard-component-esb-this)