Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am calling an API by using tRest component and through that API, json file is getting.
The last rows for json file looks like below:
"totalRecords":250,
"totalPages":25,
"numberOfRecords":10
In tRest, URL segment the value is "api_url + "api/ver41/Student/getModifiedList?pageIndex=1&size=10&GetByDateTime=2019-09-30%0900:00:00.000""
I need to pass this URL as parametrized i.e. to read the file by API call, and then pass "numberOfRecords" and "totalPages" to
size and pageIndex of URL respectively. Number of records/TotalRecords are dynamic, they can be changed.
Attached is the tRest configuration.
Thanks in advance.
Hi @mks02 ,
If I understand this correctly, then you can
1. take that json output in tExtractJSONFields and can manipulate the data, then
2. take further the output to tFlowToIterate and the iterate the output to the tRest component.
3. In tRest components URL section, you can read the output of tFlowToIterate as Global Variables. eg. (String)globalMap.get("row6.totalRecords")
Second way is to use tContextLoad, to pass the URL's dynamically.
Hope this helps you!!
Hi @amitdadri ,
Thanks for your valuable time. I am calling that api (url) to get that json file. Below is the correct mapping:
tRest --> tFileOutputRaw (to get that file in json format)
After this step, I can apply your suggestions.
But in tRest URL's section, how could I pass parametrized values for total number of records/page size and currentdate in URL.
For tContextLoad, could you please explain in detail.
Thanks.
Hi,
This link may help you :
https://community.talend.com/t5/Design-and-Development/tRest-response-with-pages/m-p/163242#M99422
Regards
Martin