Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Anyone could help on how to extract results from an API (https://minelead.io/docs/#operation/Search ) and split them into columns
i have a simple job with tRest components that is working
Also, what is the difference between tRestClient vs tRest ?
Image attached
Hi @AmiHall1 ,
Concerning tRest / tRestClient :
As @xdshi explained in this post : https://community.talend.com/t5/Design-and-Development/tRest-v-s-tRestClient/td-p/99188
"component tRestClient exist in talend open studio under the ESB package using Apache CXF technology, but the tRest is under the Internet package using the technology of Rest. They need different Configuration parameters and technology. You can choose one of them which is up to your requirement and technology."
About how converting json response from api into columns,
i recomand you to see this :https://help.talend.com/reader/sgE1qM_4~9kOIJyS0XV1zA/WDdZLETtsTtpdN7TRzEF~g
and this : https://support.smartbear.com/alertsite/docs/monitors/api/endpoint/jsonpath.html
tExtractJsonField component can parse a json string and generate rows with a schema, based on jsonPath or XPath query defined in the configuration.
For example, if you have a json like :
{"name":"totoro", "country":"japan"}
The JsonPath query to get name value could be : "$.name" and it would return a String.
This is how to convert a string (Valid Json) in a row with schema structure:
Job Design : tFixedFlowInput ---- tExtractJsonField ---- tLogRow
Config of tFixedFlowInput for this example :
Config of tExtractJsonField :
This is how you can "convert" a json string (which in your case is the response from the API) in row with schema.
The json was {"name":"totoro", "country":"japan"}
And the result is :
name | country (schema)
totoro | japan (row)
Hope this will help you.
Best regards.