Extracting Discovery Metadata from OneTrust
You can extract metadata from the Data Catalog module by using the Get Catalog Search Results API. This will allow you to return values for the id, documentType, name, and searchModule parameters along with values for each searchFieldName entered within the selectFields parameter.
Prerequisites
-
Developer tool to conduct calls, like Postman
-
Familiarity with making API calls, creating tokens, and understanding responses
-
Client Credentials created in OneTrust. For more information, see Managing OAuth 2.0 Client Credentials.
-
Configured Advanced Search in Data Catalog
Using the API
View the Get Catalog Search Results API Documentation here. The below parameters are always returned in the response. This API can also be used to obtain acceptable values for the selectFields parameter, see section below for more.
-
id -
documentType -
name -
searchModule
Important Parameters
-
"searchText"can be left empty to locate all criteria results or provide a specific value to return text matches from the document metadata. Using just this parameter without any attribute fields is the same, basic functionality as using the search bar in the Catalog Search screen. -
"selectFields"similar to the Advance Search functionality in the application, this parameter will identify metadata based on the provided term attributes. Combined withsearchText, this will identify all metadata that matches the field with the supplied text value.Note:You may need to make a separate call using the Get Search Fields Detail API to retrieve all possible search fields and their supported operators.
JSON{ "searchFieldName": "dataelementTerm", "searchFieldDataType": "Collection<String>", "operators": [ "LIST_CONTAINS,", "LIST_DOES_NOT_CONTAIN,", "IS_EMPTY,", "LIST_CONTAINS_ANY_OF,", "LIST_DOES_NOT_CONTAIN_ANY_OF,", "IS_NOT_EMPTY" ] } -
"filterCriteria"decides how to return metadata results using a combination of AND/OR operators to establish conditions. You can insert multiple criteria groups to build complex expressions that align with the provided term attribute values forselectFields.Each criteria group will have its own operators, which will be unique to the term attribute, especially if it has multiselection available.
Example Call
This request is searching for csv files that have the term ABA Routing Number. The response will return all possible files that have that term.
REQUEST
{
"searchText":"",
"selectFields":[
"fileType",
"dataelementTerms"
],
"filterCriteria":{
"groupOperator":"AND",
"criteriaGroups":[
{
"operator":"AND",
"criteria":[
{
"searchField":"fileType",
"operator":"EQ",
"value":"csv",
"searchFieldDataType":"String"
},
{
"searchField":"terms",
"operator":"EQUALS_TO_ANY_OF",
"multivalue":"ABA Routing Number",
"searchFieldDataType":"Collection<String>"
}
]
}
]
}
}
RESPONSE
{
"data":{
"documents":{
"data":[
{
"id":"172a829d-0f9f-45ab-b5f5-028d228c6edg",
"documentType":"Metadata",
"name":"abaroutingnumberreport.csv",
"searchModule":"governance",
"dataelementTerms":"<ABA Routing Number>"
"fileType":".csv"
}
]
}
}
}