When working with HTTP REST, there are cases where you may need to retrieve the whole response of the API operation instead of granular fields.

As an example, you may want to retrieve the whole JSON data at once and load it into one target field, instead of loading each field of the JSON structure.

The article purpose is to show how to retrieve whole response data and load it into one field.

 

Prerequisites:
  • HTTP REST Component 2.2.0 or higher.

 

Retrieving whole response

In a Mapping, when using an HTTP REST Metadata, you can retrieve the whole responses content using a dedicated extra field.

Simply add the extra field named "rawContent" under the response node:

rawcontent field

 

Then, you can map it into your target field as usual:

 

mapping rawcontent

 

The data loaded in the target column will then be the whole content which, in this example, is JSON data such as:

 

{
    "response": {
        "data": {
            "customer": {
                "cus_id": "0",
                "tit_code": "M",
                "cus_first_name": "John",
                "cus_last_name": "Doe",
                "cus_company": "acme"
            }
        }
    }
}

 

Note

The rawContent extra field is not supported for binary data.

To read binary data such as files, and more, returned by REST APIs, simply use the usual content node defined as BINARY.