Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi team
I am able to obtain the JSON response as part of an API GET request via postman.
I am using the same headers in tREST as well as tRESTClient components, I am getting the status code as 200 but the body, I am not getting as JSON format instead I am getting in some decoded format or something.
How to resolve this issue and how to obtain the response in exact JSON format.
Thanks
DBS
I think the actual data isn't in the right JSON format like you expected. This could be because of how the data is being encoded or sent back from the API. To fix this, check the headers you're sending with your request to make sure they match what the API expects. Specifically, look at the "Content-Type" header and make sure it says "application/json". This tells the API you want the data in JSON format. If it still doesn't work, take a closer look at the response body itself to see if there are any strange characters or codes that might need to be decoded or handled differently. Adjusting these settings should help you get the API response in the correct JSON format and it works on every other app as well, like you can also implement it on some streaming platforms like Netflix and DixMax app. Hope this works.
It looks like the API response isn’t in proper JSON format. Make sure your request headers include Content-Type: application/json so the API knows to send JSON. If it still fails, check the response body for unusual characters or encoding issues. Fixing these should make the data work correctly, just like it does on other apps and streaming platforms like Netflix or magis app. we hope this will work better.
The "decoded format" you are seeing is likely Talend's internal Document type (XML representation) or a Base64 encoded string, which tRESTClient often uses by default for response handling.
To resolve this and obtain an exact JSON format, follow these steps:
1. Disable Automatic XML Conversion (tRESTClient)
By default, tRESTClient attempts to convert JSON responses into a DOM document (XML) for easier mapping in Talend's ESB components.
2. Configure the Accept Type
Ensure the component explicitly requests JSON from the server to match your Postman configuration.
3. Access the Correct Output Column
The tRESTClient component has a fixed output schema with three main columns: statusCode, body, and string.
4. Handle Gzip Compression (If Applicable)
If your API returns compressed data, tRESTClient may sometimes fail to decode it properly in the Error flow, though it usually handles it for successful 200 OK responses.
Summary Workflow:
tRESTClient (Uncheck 'Convert response to DOM') -> tExtractJSONFields (Link to 'string' column) -> tLogRow.