Sample parameter

Specify the Sample parameter in the JDBC URL of a REST API connection. The REST response is a tabular schema that you can import to Cognos Analytics as a data module.

The JDBC URL field appears when you create a data server connection and select Progress Data Direct Autonomous REST connection as the connection type.

For more details: Read the topic Using the Sample property method

Syntax

jdbc:ibmcognos:autorest:Sample='endpoint_URL'

The endpoint URL

The endpoint URL is a REST API location that returns data that you can use in Cognos Analytics. It can contain many optional connection properties to accommodate various types of API responses and authentication. For example, its properties support many OAuth 2.0 authentication flows which vary based on the security needs of each web service.

Example URLs

The following connection performs an HTTP GET on the URL http://worldtimeapi.org/api/timezone/America/Toronto. The JSON response returned from the endpoint is represented as a table with columns that correspond to the fields in the response.

jdbc:ibmcognos:autorest:Sample=http://worldtimeapi.org/api/timezone/America/Toronto

When a URL includes characters that are used by the driver, you must enclose it in single quotes. The following URL includes a query string in which the name-value pair includes an equal sign (=).

jdbc:ibmcognos:autorest:Sample='http://myWebSite/resources?type=dog'
Note: For additional examples, see Examples using the Sample parameter method.