In the earlier tutorials of this series, we showed you how to do the following using the Autonomous REST Connector:
In the final tutorial, we will discuss how to configure paging in the Autonomous REST Connector to allow you to return multiple pages in your response. Most REST services implement paging to reduce the loads on the server and improve performance when accessing large amounts of data. However, when querying the Yelp API in earlier tutorials in this series, you were only seeing data from the first page of the API response. This was fine for demonstration purposes, but, in a production environment, you would likely need to access the data beyond the first page.
The Autonomous REST Connector supports the following paging mechanisms:
If we take a look at the Yelp documentation on how to page results, you will notice the use offset paging parameters:
Parameter | Type | Description |
---|---|---|
limit | int | Optional. Number of business results to return. By default, it will return 20. |
offset | int | Optional. Offset the list of returned business results by this amount. |
To configure row offset paging for Yelp, we will need to set the following Autonomous REST Connector paging properties using the Autonomous REST Composer:
Property | Description |
---|---|
#maximumPageSize | Specifies the maximum page size rows. |
#pageSizeParameter | Specifies the name of the URI parameter that contains the page size. In the case Yelp, this would limit. |
Note that the Autonomous REST Connector supports a number of paging properties to configure different paging mechanisms and implementations. For more information on configuring supported paging mechanisms, refer to Paging in the Progress DataDirect Autonomous REST Connector for JDBC User's Guide.
In this section, we are going to configure the Autonomous REST Connector to page results returned from Yelp. Since Yelp uses offset paging parameters, you will need to configure a subset of the driver's row offset parameters to control paging. In the following steps, we will demonstrate how to configure paging for the Events endpoint.
GET https://api.yelp.com/v3/events/events
50
limit
0
offset
SELECT * FROM EVENTS
You should receive over 200 records, instead of the 20 records you saw with the default paging configuration.
You have reached the end of this tutorial series. By completing this series, you have learned how to:
To learn more, refer to the Tutorials or Documentation for the Autonomous REST Connector.
The Autonomous REST Connector provides JDBC and ODBC connectivity to Yelp, GitHub, Jira, and many other REST APIs.