In the Part 1 of the tutorial series, we guided you through connecting and querying data on a REST endpoint using the Progress DataDirect Autonomous REST Connector. If you stumbled on this tutorial first, we would recommend you start with Part 1 of this tutorial series.
Also in Part 1, we demonstrated querying data from just a single endpoint; however, REST services are typically comprised of multiple endpoints that return data.
C:\exampleREST\yelp.rest
"categories":https://api.yelp.com/v3/categories
Let’s look at the three endpoints that we are going to sample in this tutorial.
In part 1, we sampled a single endpoint by setting the REST Sample Path to a single Yelp endpoint. The REST Sample path, allows you to sample one endpoint at a time, but if you want to sample multiple endpoints, you need to set the REST Config file to yelp.rest file that you have created.
SELECT * FROM V3_CATEGORIES
SELECT * FROM CATEGORIES WHERE alias LIKE '%food%'
SELECT C.ALIAS, C.TITLE, CW.COUNTRY_WHITELIST, CW."POSITION"
FROM
CATEGORIES C
INNER JOIN
COUNTRY_WHITELIST CW
ON
CW.CATEGORIES_ALIAS = C.ALIAS
--Events API
SELECT * FROM EVENTS
SELECT * FROM BUSINESS WHERE LOCATION= 10001
SELECT * FROM BUSINESS WHERE LOCATION='94016'
SELECT * FROM BUSINESSES B
INNER JOIN CATEGORIES_1 C ON B."POSITION" = C.BUSINESSES_POSITION
WHERE B.LOCATION='10001' AND C.LOCATION='10001'
SELECT * FROM BUSINESSES B
INNER JOIN CATEGORIES_1 C ON B."POSITION" = C.BUSINESSES_POSITION
WHERE B.LOCATION='10001' AND C.LOCATION='10001'
AND c.ALIAS LIKE '%brunch%'
Optionally, add additional endpoints to your Model file. Note that you will need to reconnect for the connector to sample and generate tables for the endpoints that you have added. After sampling, you will be able to query these tables.
In the next tutorial, we we will guide you through editing the auto-generated schema.