Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
rohitk1609
Master
Master

How to make URL dynamic in REST connection ?

Hi Techies,

I have use case where I need to make URL dynamic which is getting used in REST connector. The sample request  which we use in browser URL bar is 

https://API.com/Enterprise/v1.0/sales/site/Mumbai Harbor/1336/?start_time=202001091200&end_time=202001091215

Now

if I use https://xxxxxxxxx.com/Enterprise/v1.0/sales/site/Mumbai Harbor/1336/ in URL section of REST connector and 

WITH CONNECTION

(    QUERY "start_time"         "$(vReportStartDate)",

     QUERY "end_time"           "$(vReportEndDate)"

);

so it works fine but my use case say we need to make Mumbai Harbor and city code 1336 dynamic so we can use one rest connection for all cities and their sites.

Can anyone please help me to make the URL dynamic ?

Thanks in advance

Rohit

Labels (2)
1 Solution

Accepted Solutions
Levi_Turner
Employee
Employee

So you currently have this defined in the WITH CONNECTION part:

WITH CONNECTION
(    QUERY "start_time"         "$(vReportStartDate)",
     QUERY "end_time"           "$(vReportEndDate)"
);

This can be added to in order to further variablize the URL:

WITH CONNECTION
(   
	URL "https://xxxxxxxxx.com/Enterprise/v1.0/sales/site/$(city)/$(citycode)/ "
	QUERY "start_time"         "$(vReportStartDate)",
	QUERY "end_time"           "$(vReportEndDate)"
);

 

Of course you'd want to nest that GET inside of a loop to loop over all the known values for $(city) and $(citycode) 

View solution in original post

1 Reply
Levi_Turner
Employee
Employee

So you currently have this defined in the WITH CONNECTION part:

WITH CONNECTION
(    QUERY "start_time"         "$(vReportStartDate)",
     QUERY "end_time"           "$(vReportEndDate)"
);

This can be added to in order to further variablize the URL:

WITH CONNECTION
(   
	URL "https://xxxxxxxxx.com/Enterprise/v1.0/sales/site/$(city)/$(citycode)/ "
	QUERY "start_time"         "$(vReportStartDate)",
	QUERY "end_time"           "$(vReportEndDate)"
);

 

Of course you'd want to nest that GET inside of a loop to loop over all the known values for $(city) and $(citycode)