skip to main content
Input REST file syntax
  

Try DataDirect Drivers Now

Input REST file syntax

The driver employs an input REST file to map JSON responses to the relational model. Although the primary purpose of the REST file is to define endpoint and table mapping, it is also capable of configuring a number of driver behaviors, such as paging, custom authentication, and HTTP response code processing. This reference describes the syntax used to configure the features and functionality supported by the REST file.
The input REST file is a simple text file that uses the file_name.rest naming convention. To configure the file, you will need to populate its contents. The following is the basic structure of the REST file:
1 {
2 "#http":[<http_response_codes>],
3
4 "#<oauth2_param>":"<oauth2_value>",
5
6 "#authentication":[<custom_auth>],
7 "#reauthentication":[<custom_auth>],
8
9 "<table_name1>":"<table_definition1>",
10 "<table_name2>":"<table_definition2>",
11 "<table_name3>":"<table_definition3>"
12 }
Note: With the exception of table definitions, all REST entries described in the following table are optional.
Table 23. Input REST file components
Lines
Entry/Entry Type
Description
2
#http
Defines how HTTP response status codes are processed by the driver.
For details and syntax, see HTTP response code processing .
4
OAuth 2.0 entries
Configures OAuth 2.0 authentication behavior using a set of entries. This allows you to centrally set and manage OAuth authentication properties for all connections using the file. Note that these entries are mutually exclusive with the #authentication entry.
For details and syntax, refer to OAuth 2.0 authentication .
6
#authentication
Defines custom authentication requests that retrieve and exchange access tokens. Custom authentication is used when your service does not support one of the standard authentication methods provided by the driver. Note that this entry is mutually exclusive with the OAuth 2.0 entries.
For details and syntax, see Custom authentication requests.
7
#reauthentication
Defines the request used to refresh the access token retrieved through the #authentication entry.
For details and syntax, see Custom authentication requests.
9-11
table entries
Defines the tables and columns that are derived from REST endpoints. This section can be used to configure multiple aspects of the driver's behavior, including paging, data type mapping, and filtering.
For details and syntax, see Table definition entries .
* HTTP response code processing
* OAuth 2.0 authentication
* Custom authentication requests
* Table definition entries
* Example input REST file