Configure the Generic REST API connection
- Last UpdatedOct 08, 2024
- 4 minute read
You can provide connection information for the generic REST API to retrieve the data from shared data sources.
The generic REST API data source allows you to query private or public data such as weather, government agencies information, and so on.
Configure the Generic REST API Connection
-
In the Data Adapter Type list under Data Adapter Service, select Generic Rest API.
The Data Source Configuration section appears.
-
In the Data Source time zone list, the Coordinated Universal Time (UTC) option is by default selected. You cannot edit the time zone for Generic Rest API.
-
In the URL text box, specify the base URL for the required Rest API.
For example, if the URL is https://api.openweathermap.org/data/2.5/weather?lat=46.91945109973637&lon=6.2763601429257125&appid=142170e30e9f2a4fd492e3b7581, then:
-
the base URL is https://api.openweathermap.org/
Note: It is mandatory for a base URL to end with the forward slash / symbol.
Note: Base URL for DataHub datasource is tenant-based (see the Client Credentials section below.) -
the ItemPath is data/2.5/weather
-
the Query expression is ?lat=46.91945109973637&lon=6.2763601429257125&appid=142170e30e9f2a4fd492e3b7581
-
Under the Custom Queries tab, ItemPath and QueryExpression are configurable with the ItemPath and QueryParameter within a data source object.
Note: It is mandatory for a Query expression to begin with the question mark ? symbol.
-
-
In the Authentication Type dropdown list, select either of the following authentication types to authenticate the API call:
-
API key
Select the API Key type to authenticate using the REST API key, and then perform the following:
-
In the Key box, specify the authentication key for the required Rest API.
-
In the Key Value box, specify the key value for the required Rest API.
-
Select either Query or Header for the retrieval request. The API documentation mentions whether to use Query or Header. For example, OpenWeather API supports Header.

-
-
Bearer token
Select the Bearer Token type to authenticate using the bearer token of the required API. In the Token box, enter the bearer token of the required API. For example, Insight APIs such as Historian, MES, or CIM.

-
Client credentials
Select the Client Credentials type to authenticate Insight ADH API. The URL is tenant based. Enter the Token Url, Client Id, and Client Secret. The token Url differs according to regions:
-
West US (primary): https://uswe.datahub.connect.aveva.com/identity/connect/token
-
Northern Europe: https://euno.datahub.connect.aveva.com/identity/connect/token
-
East Australia: https://auea.datahub.connect.aveva.com/identity/connect/token
The example below shows the North Europe token Url.

-
Create client credentials for Insight ADH API:
-
Log into your AVEVA account with your credentials.
-
Click on the Data Hub tenant.
-
From the menu tab, select Security and then Clients.
-
Click Add Client.
-
Type in or select the name, tenant roles, and token lifetime (or keep the default token lifetime value).
-
Click Continue.
-
You may add a Secret description. It is optional but recommended.
-
Select or deselect the Never Expires checkbox based on your requirements.

-
Click Add.
The Client is successfully created, and the required credentials appear. Make sure to copy or save the credentials, especially because Client Secret appears only once.
After selecting a Client from the list, a right-hand-side pane appears and provides the required Client details. The pane also provides Connection Information, which contains the Tenant ID and Namespaces of different regions. The URL must contain the tenant ID and namespace.

-
Choose the correct tenant ID and namespace details based on the region.
-
-
Click Connect. If the connection succeeds, the Getting schema notification message appears. It can take a few minutes to retrieve the schema from the data source. For more information about retrieving the schema, see Retrieve the schema.
-
Click Done and then click Save.