Dynamic Rest Resource Endpoint


(Tbaatar) #1

Hi,

 

I'm currently testing the Rest Resource asset to pull in JSON data. The particular JSON data/end point is dynamic so different data is pulled based on date parameter

 

For example the following HTTP Requests pull in totally different data:

Request 1: http://www.domain.com/calendar/2015-08-30 > pulls down JSON data for Aug 30
Request 2: http://www.domain.com/calendar/2015-09-15 >  pulls down JSON data for Sep 15

also pass additional parameters like date range so example:

Request 3: http://www.domain.com/calendar/2015-09-15/3> pulls down JSON data from Sep 15 - Sep 18

Currently Rest Resource asset is a must because it involves Basic HTTP authentication with username/password. This is then nested into JSON Data source asset and displayed using Asset Listing.

 

Users will interact with location (e.g city) select form date and the number of day(s) and search using the Rest Resource Asset.

 

So the question is how can you make the Rest Resource HTTP Resquest URL dynamic?

 

 

Thanks,

Tuguldur


(Bart Banda) #2

You can put global keywords into the URL field of the REST resource asset. 

For example:

http://www.domain.com/calendar/%globals_post_date%

Is that what you need?


(Tbaatar) #3

Thanks for the reply Bart.

 

I'l give this a go.

 

What about passing date range and specific location?

Example if you want to search events for Amsterdam between June 1 - June 14? Can you add secondary or third global argument?


(Bart Banda) #4

Yea you can pass as many parameters to the URL as you want, and any globals keyword works, for example http://www.domain.com/calendar/%globals_post_date%?location=%globals_cookie_location%&end_date=%globals_metadata_end-date%


(Tbaatar) #5

Cool.

 

Will experiment and get back with findings.

 

Thanks