Example of Related Record Search

Consider the following example: searching for a related record where street name is "Rockford", customer type is not equal to "NonIT", and customer's date of birth is greater than "03/10/1985" in the "Company" and "Customer" repositories.

Example - Request

{
  "name": "Company",
  "productKey": -1,
  "attributes": [
    {
      "name": "Street",
      "value": [
        "Rockford"
      ],
      "operator": "eq",
      "caseSensitive": false
    }
  ],
  "relationships": [
    {
      "name": "companycustomer",
      "count": 1,
      "checkExistence": true,
      "relationshipAttributes": [
        {
          "name": "RCustomerType",
          "value": [
            "NONIT"
          ],
          "operator": "ne",
          "caseSensitive": false
        }
      ],
      "repository": {
        "name": "Customer",
        "attributes": [
          {
            "name": "DOB",
            "value": [
              "03/10/1985"
            ],
            "operator": "gt",
            "caseSensitive": false
          }
        ]
      }
    }
  ]
}

Example - Response

The response returns all the records matching the search criteria. In the following response example, street name is "Rockford", customer type is "IT", and customer's date of birth is greater than "03/10/1985".

{
   "records": [   {
      "productId": "REC1",
      "productIdExt": "REC1",
      "productKeyId": "21538",
      "version": "1",
      "state": "CONFIRMED",
      "key": 21538,
      "effectiveDate": null,
      "attributes":       [
         ...
         ...    
     {
            "name": "Street",
            "value": null,
            "displayName": "Street",
            "multivalues":             [
               "11th St",
               "Rockford"
            ],
            "type": 4,
            "id": 0,
            "groupName": "Unassigned",
            "associationName": null,
            "auxiliaryContent": null,
            "multivalue": true
         }
          ...
          ...
           ],
      "repositoryName": "COMPANY",
      "classificationSchemeDetails": null,
      "relationships": {"companycustomer": [      {
         "relationshipAttributes":          [
            ...
            ...                        
{
               "name": "RCustomerType",
               "value": "IT",
               "displayName": null,
               "multivalues": null,
               "type": 4,
               "id": 0,
               "groupName": null,
               "associationName": null,
               "auxiliaryContent": null,
               "multivalue": false
          }
          ...
          ...
            ],
         "targetRecord":          {
            "productId": "REC2",
            "productIdExt": "REC2",
            "productKeyId": "21539",
            "version": "1",
            "state": "CONFIRMED",
            "key": 21539,
            "effectiveDate": null,
            "attributes":             
        [
           ...
           ...             
              {
                  "name": "DOB",
                  "value": "03/10/1986",
                  "displayName": "DOB",
                  "multivalues": null,
                  "type": 1,
                  "id": 0,
                  "groupName": "Unassigned",
                  "associationName": null,
                  "auxiliaryContent": null,
                  "multivalue": false
               },  
            ... 
            ...                           
      }],
   "totalCount": 1
}