Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I need get some list of data from an api which is given to me. The api url is something like mentioned below
http://api.xyz.com/1/statuses/home_timeline.json?since_id=12345&max_id=54321&created=2020-01-09T00:00:00Z&created=2020-01-10T00:00:00Z)
Over here we have two dates 9th Jan and 10th Jan. Hence, I need all the the data of 9th Jan for entire 24 hrs in json format. What should be the talend job design. I had checked couple of talend community posts which suggests I need to use tRestClient however, I am not sure how to proceed further. Please suggest on the same
Hi,
your job design will look like :
trestClient --ResponseOK--> tExtractJSONField --main--> tLogRow
Hi,
your job design will look like :
trestClient --ResponseOK--> tExtractJSONField --main--> tLogRow
Can you please provide an example. A job flow screenshot would be appreciating. Also the created date will be based on the current date created>=2019-01-09T00:00:00Z and created<2019-06-10T00:00:00Z where in date with < will be the current date and time, and >= will be the subtracted date based on data provided in context property file like 6 hrs , 12 hrs, 24 hrs etc.
Hi Team,
As per the instruction I am able to get the desired result however, I am facing another issue in the same. After I extract the json with the help of textractjsonfields component I am getting some ids (let say 1111, 2222 etc). I want to iterate through this ids and create a separate url which will be used to hit another api using tRestClient. The current flow is mentioned below
tRestCliet->tExtractJsonFields-> Getting the Ids over here and need those ids to build a url like mentioned below
https://api.xyz.com/1111/details.json
https://api.xyz.com/2222/details.json
Only the id value will change, hence I need to iterate through this ids to create individual urls which is to be called individually to capture the response.
Please suggest any resolution for the same.
Hi,
If you only need the id sent from your first service, an example could be :
Talend schema
tsetglobalvar parameters
second api call
filter your ids with tFilterColumns and delete the possibly duplicates with tUniqRow, then tFlowtoIterate permits to make a treatment id by id.
Write your id in a globalVar with tsetglobalVar and use it 'OnComponentOK' in your tRESTClient_2 as explained in the pictures.
Regards,
Pierre
Thanks it worked for me.
Hi Team,
If I want to use the same id to call another api to extract some data how to proceed in such a scenario. Like say
After textractJsonFields I want to have another api call with the id which is the current iteration value
https://api.xyz.com/details/1111/comments.json where 1111 is the id, which is the current iterated value using tflowToIterate component.