skip to main content
Input REST file syntax : Example input REST file
  

Try DataDirect Drivers Now

Example input REST file

The following is an example input REST file that can be modified for your environment.
{
//An entry that defines how HTTP response status codes are processed by the driver.
"#http":[ { "#code":200, "#action":"FAIL", "#operation":"SELECT",
"#match":"\"status\":\"error"", "#message":"{message}", },
{ "#code":200, "#action":"OK" },
{ "#code":400, "#action":"ZERO_ROWS" },
{ "#code":401, "#action":"REAUTHENTICATE" },
{ "#code":404, "#action":"ZERO_ROWS" },
{ "#code":429, "#action":"RETRY_AFTER" },
{ "#code":503, "#action":"RETRY_AFTER" }]

//An entry for a custom authentication request.
"#authentication" : [
"api-key={customAuthParams[1]}",
{
"credentials": {
"username": "{user}",
"password": "{password}",
"company": "{customAuthParams[2]}"
}
},
"POST http://{serverName}/bearertoken",
"HEADER Authentication=Bearer {/access-token}"
]

// A simple GET request without parameters to sample:
"countries":"http://example.com/country",

// A GET request with a parameter in the path:
"states":"http://example.com/states/get/{countryCode:USA}/all",

// A GET request with parameters as arguments
"timeseries":"https://www.example.com/times/query?interval=5min&symbol=USA&function=TIME_WEEKLY",

// A GET request with custom HTTP headers
"people":{
"#path": "http://example.com/people",
"#headers":{
"Accept":"application/calendar+json",
"X-Subway-Payment":"token",
"X-Laundry-Service":"dryclean",
"X-Favorite-Food":"pizza"
}
},

// A POST with parameters in the body
"countries2": {
"#path": "http://example.com/country",
"#post": {
"start_date":"2018-08-31",
"end_date":"2018-09-01",
"departments":"[engineering,marketing,sales]",
"tags":"[blue,green,red]"
}
},

// A GET with paging configured
"products": {
"#path": "http://example.com/products",
"#maximumPageSize":1000,
"#firstRowNumber":1,
"#pageSizeParameter":"maxResults",
"#rowOffsetParameter":"startAt"
},
}