DataCater can stream data from REST/HTTP endpoints to any data sink and transform them on the way.
At the moment, we support only REST/HTTP endpoints that return data in the JSON format.
This source connector supports the following configuration options:
The URI of the REST endpoint, including the HTTP scheme, i.e., http:// or https://.
HTTP method to use for the request: GET or POST.
Http query parameters to use in the request, &
-separated list of =
-separated pairs.
Http headers to use in the request, ,
-separated list of :
-separated pairs.
Http body to use in the request. Only available if HTTP method POST is used.
By default, DataCater expects an array of JSON objects, each resembling a record, at the root level of the response of the REST endpoint. For all other cases, you may provide a JSON pointer pointing to the location of the array within a possibly deepled-nested JSON structure.
If the JSON Pointer points to a JSON object instead of a JSON array, DataCater will treat and extract the values of the JSON object as records.
By default, DataCater extracts the complete JSON objects of the records list as records. For all other cases, you may provide a JSON pointer pointing to the location of the record within the JSON objects.
You can choose between two approaches to defining at which times DataCater should extract data from the REST endpoint:
Depending on the option Sync mode, you can either specify the number of milliseconds or the CRON expression. By default, DataCater extracts data every two minutes, i.e., the default values are 120000 ( milliseconds ) and */2 * * * * ( CRON expression ).
Name of the attribute that uniquely identifies records. DataCater uses the primary key attribute to detect new records. Please make sure that the colum does not hold NULL values.
Username to use if the REST endpoint uses HTTP Basic authentication.
Password to use if the REST endpoint uses HTTP Basic authentication.
If the REST endpoint is using time-based access tokens for authentication, you can here specify an URI, which is called for generating a new token when the REST endpoint returns HTTP status code 401.
HTTP method to use for requesting a new token.
HTTP request headers to use for requesting a new token.
HTTP request body to use for requesting a new token. Only available if POST is used as Token exchange HTTP method.
If the token endpoint does not directly return the token string but a JSON object, you may provide a JSON pointer to locate the token string in the JSON structure.
Name of the attribute that holds the timestamp when the record has been updated the last time. DataCater uses the timestamp attribute to detect data changes.
Formatted timestamp, epoch millisecond, or epoch second (default: formatted timestamp).
The format used by the REST endpoint for timestamp values (default: yyyy-MM-DD'T'HH:mm:ss[.SSS]X). Only available when using formatted timestamp as timestamp type.
Timestamp value at which the connector should start syncing. Should be filled out, when making use of the ${offset.timestamp} variable in your request.
Regular expression pattern in value of primary key column, which shall be replaced.
Value to use for replacing pattern in value of primary key column.
Timeout of HTTP requests, specified in seconds (default: 120).
Whether to automatically convert empty strings to NULL values, when extracting data (enabled by default).
In the configuration fields HTTP query parameters, HTTP request headers, and HTTP request body, you can make use of the Freemarker template engine to build dynamic requests, which is especially useful when using change data capture.
We provide the following variables for the templating:
When extracting data in the JSON format from REST endpoints, DataCater performs the following mapping between JSON data types and DataCater data types.
JSON data type | DataCater data type |
---|---|
Array | String |
Boolean | Boolean |
Number | Double, Float, Int, or Long |
Object | String |
String | String |