This feature is disabled by default. For more information about enabling REST API connectivity in your environment, please contact |
The |
10
. This limit can be modified. You should identify the tables and (optional) data models for them that you wish to access.
You should acquire the credentials to access your target endpoints for one of the supported authentication methods.
If you are using a key or token to access the endpoints, you should generate this token before you begin.
See below.
To create this connection, in the Connections page , select the Applications tab. Click the card. See Connections Page.
Modify the following properties as needed:
Property | Description | ||
---|---|---|---|
Base URI | The base URI for the endpoints to which you wish to connect through this connection. Example:
| ||
Connect String Options | Apply any connection string options that are part of your authentication to A default string has been provided for you. For more information, see below. | ||
Authentication Type | The method by which you wish to authenticate to the endpoint. See "Authentication types" below. | ||
API endpoints | Specify the endpoints to which to connect. For more information, see "Configure endpoints" below. | ||
Test Connection | After you have defined the | ||
Connection Name | Display name of the connection | ||
Connection Description | Description of the connection, which appears in the application. |
The following types of authentication are supported for REST API connections. For each type, additional properties may require configuration.
A username/password combination is submitted as part of any request for authentication.
Property | Description |
---|---|
Username | Username to access the endpoints. |
Password | Password associated with the username. |
Authentication is submitted using a key/value pair submitted in the HTTP request header.
Property | Description |
---|---|
Header Key | Key for the header parameter used in authentication |
Header Value | Credential associated with header authentication key |
Authentication is submitted using a query parameter key/value pair submitted as part of the URL.
Property | Description |
---|---|
Query Key | Key for the query parameter used in authentication |
Query Value | Credential associated with the query parameter authentication key |
Each endpoint and method combination must be configured. To add an endpoint, click Add endpoint.
The properties are described below.
Property | Description | ||
---|---|---|---|
Method | API request method to use. Supported methods:
| ||
URL Endpoint | The endpoint that you are accessing using the specified method.
| ||
Table Name | (required) The name of the table with which you are interacting through this endpoint. | ||
Data Model | Select the type of model used for the selected table:
For more information on these data model types, see https://cdn.cdata.com/help/DWE/jdbc/pg_RESTParsing.htm. | ||
Pagination | Select the type of pagination to request to the API endpoint. See "Pagination" below. | ||
Advanced options: Custom Header | (optional) You can insert a custom header in the request as a key/value pair. To add more headers, click Add. | ||
Advanced options: Query Parameter | (optional) You can append a query parameter and value to the URL. These values are appended in the following form:
To add more query parameters, click Add. | ||
Advanced options: XPath | (optional) You can specify an XPath to be queried of the URL. |
For the selected endpoint, you can specify the type of pagination in use by the target application. Specifying the pagination allows the to retrieve larger sets of records when pagination is in use. For more information on these pagination methods, see http://cdn.cdata.com/help/DWE/ado/pg_customschemaselect.htm.
None:
(default) No pagination is applied by the endpoint.
Next page URL:
When this method is selected, the URL of the next page of results is returned as part of the response body.
Paging token:
A paging token may be returned as part of the response. To acquire the next page of results, this token must be submitted in the subsequent request as the value associated with the paging parameter.
Record offset:
Under this pagination method, subsequent pages of results can be queried based on defining the number of results (records) to offset with the query.
Page offset param defines the query parameter where you can specify the page offset to query.
Page size param defines the parameter in the request where you define the size in records of each request (page) of records.
Page size defines the number of records to request in a page.
Page number:
Similar to record offset, this method queries results based on specified page numbers.
Page number param defines the query parameter where you can specify the page number to query.
Page size param defines the parameter in the request where you define the size in records of each page of records.
Page size defines the number of records to request in a page.
During execution, you may receive an error similar from the driver to the following:
PlatformErrors: Retries errors based on the exception message. E.g. Other=PlatformErrors="Too Many Requests" MaximumRequestRetries: The number of times the driver will attempt to retry the request (Default 4) |
In this case, the default wait time for retrying a request (2 seconds) is not enough time, and the requests are piling up. You can address this issue by inserting the following connect string options:
Other='RetryWaitTime=15000' |
The above option sets the wait time before retrying to 15000ms (15 seconds). You can experiment with this value as needed.
For more information on available connect string options, see https://cdn.cdata.com/help/DWE/ado/Connection.htm.
This connection can also be created using the API.
jdbc_rest
jdbc_rest
The following example request creates a REST API connection with the following characteristics:
table1
Document
{ "vendor": "jdbc_rest", "vendorName": "jdbc_rest", "name": "REST API test", "description": "", "type": "jdbc", "params": { "base_URI": "some base URI", "connectStrOpts": "" }, "credentialType": "httpQueryBasedAuth", "credentials": [ { "queryKey": "user", "queryValue": "token" } ], "endpoints": [ { "tableName": "table1", "httpMethod": "get", "endpoint": "endpoint1", "requestBody": "", "xPath": "", "dataModel": "document", "headers": {}, "queryParams": {} } ] } |
The following example creates a REST API connection to polygon.io with the following characteristics:
Other='RetryWaitTime=15000'; |
15000
millisecondsDocument
$./results
1000
queryParams.date
is a parameter that is passed in for this specific connection type.nextPageURL
method{ "vendor": "jdbc_rest", "vendorName": "jdbc_rest", "name": "REST API", "description": "", "type": "jdbc", "params": { "base_URI": "https://api.polygon.io/", "connectStrOpts": "Other='RetryWaitTime=15000';" }, "credentialType": "httpQueryBasedAuth", "credentials": [ { "queryKey": "apiKey", "queryValue": "someKey" } ], "endpoints": [ { "tableName": "tickers", "httpMethod": "get", "endpoint": "/v3/reference/tickers", "requestBody": "", "xPath": "$./results", "dataModel": "document", "headers": {}, "queryParams": { "limit": "1000", "date": "2021-11-04T00:00:00Z" }, "pagination": { "pageurlpath": "$./next_url", "paginationType": "nextPageURL" } } ] } |
For more information, see
#operation/createConnection |
You can import datasets from through the Import Data page. See Import Data Page.
Tip: You can perform joins and unions using custom SQL as part of your initial request for data. It may be easier to import the tables as separate datasets and then to perform the join or union within the |
This section describes how you interact through with your REST data.
can use
connections for the following tasks:
Import datasets
Read Access: You must have credentials to create access the specific endpoints required to retrieve your data.
Write Access: Not supported
SSL is available over HTTPS for connections.
You can create a from the following data models:
These source objects are represented as tables in the import browser and as grid data in the Transformer page.
For more information, see Database Browser.
Not supported.
NOTE: Do not use the |