Searching Customer Profiles

This tutorial explains how to search your Customer Profiles. See Configuring ID Graph Rules, Subrules, and Data Source Views if you have not already created Customer Profiles in your Oracle Unity instance.

In this topic:

Searching ID Graph Rules for Data Records

This endpoint is used to retrieve data records with a search query. In the request, specify the ID Graph Rule to search, and a search query string. A successful response will return a list of matching data records.

Request URL

GET http://{accountURL}/api-data/v1/{access-key}/data/idgraph/<ruleID>/?q=<queryString>&limit=x&offset=y

Query Parameters

The search can be based on any combination of the attributes. Search results are ordered by best match first. There is no exact string match support.

Parameter Description
q

Search query to filter results. Supports the operators contains and equals. Both operators are not case sensitive.

  • contains: Searches for all terms specified. Can be used with multiple wildcards such as "ma*nstree*" to represent "mainstreet".
  • equals: Searches for the term provided, but is not an exact string match. Supports a single wildcard.

    For example: Searching "ain" would return "mainstreet", but searching for "ma*nstree*" would not return "mainstreet". To perform a search for a string starting with characters and ending in a wildcard, use contains.

limit Specifies the maximum number of records to return. This can be any positive integer between 1 and 100. If not specified, the default is 100.
offset Specifies an offset that allows you to retrieve the next batch of records. Any positive integer. For example, if your limit is 1000, specifying an offset of 1000 will return records 1000 through 2000. If not specified, the default is 0. Can't exceed 10,000.

Request Example

Search the ID Graph Rule named "Rule1" for data records whose first name contains the letter "a":

GET http://{accountURL}/api-data/v1/<access-key>/data/idgraph/Rule1/?q=[{"operator":"CONTAINS","attribute":"FirstName","value":"a"}]

Response Example

A successful response will return a list of the attributes searched, and the matching data records.

{
  "header": [
    {
      "name": "FirstName"
    }
  ],
  "data": [
    [
      "SRC_313225380",
      "Adam"
    ],
    [
      "SRC_313225381",
      "Christina"
    ]
  ]
}

Lookup details for a specific record according to Subrules

This endpoint is used to retrieve information about a specific data record. In the request you can specify the following:

  • An ID Graph Rule.

  • A Record Identifier (retrieved using the search above).

  • A Subrule(s) (optional, if not specified, this endpoint will return results for all Subrules in the ID Graph Rule).

A successful response will return all information about a specific data record, according to the Subrules specified in the request.

Request URL

GET http://{accountURL}/api-data/v1/{access-key}/data/idgraph/<ruleID>/<recordIdentifier>?expand=<subrule>

Where...

  • ruleID is the name of the ID Graph Rule you created.

  • <recordIdentifier> is retrieved using the search above.

  • ?expand is the optional query parameter to search specific Subrules. If specified, the search result will only return data for the specified Subrule (separated by commas if multiple). For example: ?expand=Subrule1,Subrule2.

Request Example

Retrieve information for the ID Graph Rule named "Rule1" and the record ID "SRC_313225380":

GET http://{accountURL}/api-data/v1/{access-key}/data/idgraph/Rule1/SRC_313225380

Response

The response includes detailed information about the ID Graph Rule "Rule1".

Request Example

Retrieve information for the ID Graph Rule named "Rule1" where the record ID is "SRC_313225380", and only apply the Subrules "IDGraph_Event" and "IDGraph_OrderItem" to the search results:

GET http://{accountURL}/api-data/v1/{access-key}/data/idgraph/Rule1/SRC_313225380/?expand=IDGraph_Event,IDGraph_OrderItem

Response

The response includes detailed information about the ID Graph Rule "Rule1", and only the specified Subrules.

 

Examples

Get all customer profiles with FirstName, LastName, Phone, Email, and ZipCodes containing anything (Used for preloading the profile explorer page):

curl --location --request GET 'http://{accountURL}/api-data/v1/{access-key}/data/idgraph/<ruleID>/?q=[{"operator":"CONTAINS","attribute":"FirstName","value":"*"},{"operator":"CONTAINS","attribute":"LastName","value":"*"},{"operator":"CONTAINS","attribute":"Phone","value":"*"},{"operator":"CONTAINS","attribute":"Email","value":"*"},{"operator":"CONTAINS","attribute":"ZipCodes","value":"*"}]&limit=100&offset=0' \
--header 'idcs_user_id: ec1b711f42d94d71877c901f68d5f938' \
--header 'X-RESOURCE-SERVICE-INSTANCE-IDENTITY-APPNAME: c948377b728641778fb57518977c18f9'						
GET http://{accountURL}/api-data/v1/{access-key}/data/idgraph/<ruleID>?q=[{operator":"CONTAINS","attribute":"FirstName","value":"*"},{"operator":"CONTAINS","attribute":"LastName","value":"*"},{"operator":"CONTAINS","attribute":"Phone","value":"*"},{"operator":"CONTAINS","attribute":"Email","value":"*"},{"operator":"CONTAINS","attribute":"ZipCodes","value":"*"}]&limit=100&offset=0

Search for customer profiles with the first name "DONALD":

curl --location --request GET 'http://{accountURL}/api-data/v1/{access-key}/data/idgraph/<ruleID>/?q=[{"operator":"EQUALS","attribute":"FirstName","value":"DONALD"}]&limit=100&offset=0' \
--header 'idcs_user_id: ec1b711f42d94d71877c901f68d5f938' \
--header 'X-RESOURCE-SERVICE-INSTANCE-IDENTITY-APPNAME: c948377b728641778fb57518977c18f9'						
GET http://{accountURL}/api-data/v1/{access-key}/data/idgraph/<ruleID>?q=[{"operator":"EQUALS","attribute":"FirstName","value":"DONALD"}]&limit=100&offset=0

Search for customer profiles with the first name "DONALD", living in the zip code "40647":

curl --location --request GET 'http://{accountURL}/api-data/v1/{access-key}/data/idgraph/customer360/?q=[{"operator":"EQUALS","attribute":"FirstName","value":"DONALD"},{"operator":"EQUALS","attribute":"ZipCodes","value":"40647"}]&limit=100&offset=0' \
--header 'idcs_user_id: ec1b711f42d94d71877c901f68d5f938' \
--header 'X-RESOURCE-SERVICE-INSTANCE-IDENTITY-APPNAME: c948377b728641778fb57518977c18f9'						
GET http://{accountURL}/api-data/v1/{access-key}/data/idgraph/customer360?q=[{"operator":"EQUALS","attribute":"FirstName","value":"DONALD"},{"operator":"EQUALS","attribute":"ZipCodes","value":"40647"}]&limit=100&offset=0

Search for customer profiles with the first name starting with "DONAL":

curl --location --request GET 'http://{accountURL}/api-data/v1/{access-key}/data/idgraph/<ruleID>/?q=[{"operator":"CONTAINS","attribute":"FirstName","value":"DONAL*"}]&limit=100&offset=0' \
--header 'idcs_user_id: ec1b711f42d94d71877c901f68d5f938' \
--header 'X-RESOURCE-SERVICE-INSTANCE-IDENTITY-APPNAME: c948377b728641778fb57518977c18f9'						
GET http://{accountURL}/api-data/v1/{access-key}/data/idgraph/<ruleID>?q=[{"operator":"CONTAINS","attribute":"FirstName","value":"DONAL*"}]&limit=100&offset=0

Search for customer profiles with the first name starting with "DONAL", living in the zip code "40647":

curl --location --request GET 'http://{accountURL}/api-data/v1/{access-key}/data/idgraph/<ruleID>/?q=[{"operator":"CONTAINS","attribute":"FirstName","value":"DONAL*"},{"operator":"EQUALS","attribute":"ZipCodes","value":"39094"}]&limit=100&offset=0' \
--header 'idcs_user_id: ec1b711f42d94d71877c901f68d5f938' \
--header 'X-RESOURCE-SERVICE-INSTANCE-IDENTITY-APPNAME: c948377b728641778fb57518977c18f9'						
GET http://{accountURL}/api-data/v1/{access-key}/data/idgraph/<ruleID>?q=[{"operator":"CONTAINS","attribute":"FirstName","value":"DONAL*"},{"operator":"EQUALS","attribute":"ZipCodes","value":"39094"}]&limit=100&offset=0

Search for customer profiles with the first name containing with "NAL" anywhere in the string, living in the zip code containing "107", anywhere in the string:

curl --location --request GET 'http://{accountURL}/api-data/v1/{access-key}/data/idgraph/<ruleID>/?q=[{"operator":"CONTAINS","attribute":"FirstName","value":"*NAL*"},{"operator":"CONTAINS","attribute":"ZipCodes","value":"*9094*"}]&limit=100&offset=0' \
--header 'idcs_user_id: ec1b711f42d94d71877c901f68d5f938' \
--header 'X-RESOURCE-SERVICE-INSTANCE-IDENTITY-APPNAME: c948377b728641778fb57518977c18f9'						
GET http://{accountURL}/api-data/v1/{access-key}/data/idgraph/<ruleID>?q=[{"operator":"CONTAINS","attribute":"FirstName","value":"*NAL*"},{"operator":"CONTAINS","attribute":"ZipCodes","value":"*9094*"}]&limit=100&offset=0

Learn more

Customer 360 User Documentation

Configuring ID Graph Rules, Subrules, and Data Source Views