Xplenty's Rest API Component Tutorial

Xplenty's Rest API Component Tutorial

Oct 21, 2021

In this video, we will set up a Rest API connector using Xplenty.

Combining your business data in one secure destination is desirable if you want to analyze and operationalize that data at scale.

Xplenty's REST API connector helps you connect to many popular business SaaS and other digital services.

Xplenty Website: https://www.xplenty.com/

Xplenty LinkedIn Page: https://www.linkedin.com/company/xplenty/

Advanced Features of Xplenty's REST API Connector Pagination Schemes

When retrieving data in large amounts, it is typical for any API to incorporate a paging mechanism. The commonly used methods for pagination are:

  • Providing a page number parameter
  • Providing an offset and limit parameters
  • Using Link headers in the HTTP response

You'll be able to fetch data using any of these methods in the REST connector. There's also an option for an Automatic pagination scheme to detect the pagination scheme used by the URL host/path. Here's a list of endpoints where the REST API connector can handle pagination right out of the box. If you'd like Xplenty to support some other endpoint for pagination, don't hesitate to contact our support team for assistance. Rate Limiting

Some APIs you use might have a daily usage limit or might only allow a certain number of requests in a specified time interval, or maybe the server resources are limited, and you might not want to overwhelm the server with lots of Requests. The REST API connector provides a provision to add sleep intervals or add a strict upper limit to the paginated API calls. Furthermore, if you have an API quota that renews after a specified interval, you can attach this package to an Xplenty schedule to run it periodically on its own. JSON Path Expression for the Base Response

If the response type is JSON, it's a common use-case to explore only specific fields of interest from the base level response. The REST API connector lets you specify JSON path expressions for base-level records to make such selection convenient. The path expressions support arrays, and you can select nested objects as well. For example, suppose the information you want to extract from the API response lies in array form within the "data" attribute. In that case, you can specify a path expression like $.data[*] to ignore other top-level information while specifying the schema. You can try the JSONPath Online Evaluator to figure out the right JSONPath expression for your data. Specifying the Schema Interactively

The REST API connector provides an interactive way to preview the data, select (or filter) relevant fields, and assign a value type to build the schema. The connector automatically performs a test API call to get a sample of actual data for preview and automatically detects the data types of response fields (like DateTime, long, boolean). The collection-level field types like MAP and BAG can further be explored/flattened in subsequent pipeline components using various Xplenty functions.