Welcome Guest! Log in
Stambia versions 2.x, 3.x, S17, S18, S19 and S20 are reaching End of Support January, 15th, 2024. Please consider upgrading to the supported Semarchy xDI versions. See Global Policy Support and the Semarchy Documentation.

The Stambia User Community is moving to Semarchy! All the applicable resources have already been moved or are currently being moved to their new location. Read more…


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.

 

Articles

Suggest a new Article!