Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to extract rest API results into columns

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

Labels (3)
2 Replies
fdenis
Master
Master

hi,
your rest application is replying with json format.
so you can use tXmlMap to split it into columns.
good luck
Anonymous
Not applicable
Author

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 :
0683p000009M7RL.png

 

 

 

Config of tExtractJsonField :

0683p000009M7h3.png0683p000009M7lj.png

 

 

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.