Consume data using the REST API
The REST API supports querying data stored in a data hub. In addition, the named query feature provides customized REST endpoints to consume data with predefined structures and query parameters.
Query records
Query multiple records
Method |
|
---|---|
Base URL |
|
URL |
|
URL structure |
The URL is configured using the following values:
|
Supported parameters |
|
Response format |
The response contains the list of records with the query expressions. Multiple records query: sample response
|
Query a single record
Method |
|
---|---|
Base URL |
|
URL |
|
URL structure |
The URL is configured using the following values:
Record ID structure
The
For example, to query a source data record ( |
Supported parameters |
|
Response format |
The response contains the list of query expressions. Single record query: sample response
|
Count records
Method |
|
---|---|
Base URL |
|
URL |
|
URL structure |
The URL is configured using the following values:
|
Supported parameters |
|
Response format |
The response contains the count of records. Record count query: sample response
|
Use named queries
Named queries provide customized REST endpoints to consume data with a predefined structure and query parameters.
For more information about designing named queries, see Configure named queries.
Query multiple records with a named query
Method |
|
||
---|---|---|---|
Base URL |
|
||
URL |
|
||
URL structure |
The URL is configured using the following values:
|
||
Supported parameters |
In addition, query parameters are passed to the query using their name. For example:
|
||
Response format |
The response contains a hierarchy of objects corresponding to the named query definition. |
Count records in a named query
Method |
|
---|---|
Base URL |
|
URL |
|
URL structure |
The URL is configured using the following values:
|
Supported parameters |
In addition, query parameters are passed to the query using their name. For example: |
Response format |
The response contains the count of records returned by the named query. |
REST API query parameters
View types
Certain REST endpoints use a view type as part of their URL. This view type, identified by an alias (GD
, MD
, etc.) defines the type of data (golden, master, errors, etc.) queried for the entity, using the endpoint.
GD
view/api/rest/query/HR/Employee/GD
MD
view/api/rest/query/HR/Employee/MD
Some of these view types must be contextualized to list records for a given load ID or a given point in history (identified by a batch ID or as-of date).
GH
view as of batch 2565/api/rest/query/HR/Employee/GH(22565)
Other view types ignore this contextualization syntax. You must use filtering to query a subset of the records. |
/api/rest/query/HR/Employee/GD?$f=BatchID=22565
The following table lists the most common view types.
View type | URL contextualization | Description |
---|---|---|
|
Golden data consolidated and certified records. |
|
|
Errors detected after master data consolidation (post-consolidation), for matching entities. |
|
|
Golden data consolidated and certified records, filtered to only show those with errors (matching entities only) |
|
|
Golden data history. |
|
|
|
Golden data history as of batch or golden data if not historized. This view type requires a |
|
Deleted golden records logs (and data for soft delete). |
|
|
Enriched, validated, and cleansed master records. |
|
|
Master records history. |
|
|
|
Master data history as of batch or master data if not historized. This view type requires a |
|
Deleted master records logs (and data for soft delete). |
|
|
Source records from finished loads. |
|
|
Errors on source records, returned with the data from the erroneous record. |
|
|
Source records from finished loads, filtered to only show those with errors. |
|
|
|
Source data loaded by the publishers for a given load. This view type requires a |
|
Source data authored by users. |
|
|
Errors detected on source authoring data. |
|
|
Source data authored by users with errors. |
|
|
|
Source data authored by users for a given load. This view type requires a |
For more information about the views and their aliases, see Data access views, attributes, and lineage.
Pagination
When calls return a large number of records, it is recommended to page the record set. By requesting smaller subsets of data, you will get a response much faster than when requesting the entire, potentially large, record set.
Parameter | Default value | Description |
---|---|---|
|
0 |
Defines the record offset for pagination. |
|
100 |
Defines the maximum number of returned records. |
/query/CustomerAndFinancialMDM/Customer/GD?$offset=20&$limit=10
Query expressions
Query expressions define which values are returned by the query for each record.
Parameter | Default value | Description |
---|---|---|
|
USER_ATTRS |
Defines the set of base attributes to include in the records, in addition to those specified using the
|
|
N/A |
Expression to include to the record in addition to, or to remove from, the base attributes (
|
/query/CustomerAndFinancialMDM/Customer/GD?$baseExprs=USER_ATTRS&$expr=Creator&$expr=CreationDate
/query/CustomerAndFinancialMDM/Customer/GD?$baseExprs=NONE&$expr=Name:Upper(CustomerName)&$expr=Revenue:TotalRevenue
/query/CustomerAndFinancialMDM/Customer/GD?$baseExprs=USER_ATTRS&$expr=$exclude:TotalRevenue
Sorting
Sort expressions define the order of the records in the response.
Parameter | Default value | Description |
---|---|---|
|
None |
SemQL |
/query/CustomerAndFinancialMDM/Customer/GD?$orderBy=TotalRevenue%20DESC,CustomerName%20ASC
Filtering
Use filters to request only specific records that match your specified criteria.
Parameter | Default value | Description |
---|---|---|
|
SemQL filter. It is a SemQL condition applied to filter records. Only records matching this condition are returned. You can combine multiple SemQL filters in the same query. |
/query/CustomerAndFinancialMDM/Contact/GD?$f=FirstName%20LIKE%20%27Joe%25%27