Unify and manage your data

preserveURIs option

If this parameter is present, the Entities takes into account URIs you specify in the request. You can use this parameter for both entity and attribute URIs.

Example 1. Entities URIs in the Request

If this option is present for an entity URI, the API finds this entity and overrides it with attributes in the request. It can be used for inserting new attributes with new/existing crosswalks to entities. If this type of entity doesn't exist, the API returns the EXPLICIT_URI_OF_NON_EXISTING_OBJECT_DEFINED(242) error.

Note: For performance considerations, we recommend you use the override by crosswalk method.

Existing Entity

{
   "uri":"entities/0001L5U",
   "type":"configuration/entityTypes/HCP",
   "createdBy":"test.user",
   "createdTime":1459517575267,
   "updatedBy":"test.user",
   "updatedTime":1459517575267,
   "attributes":{
      "FirstName":[
         {
            "type":"configuration/entityTypes/HCP/attributes/FirstName",
            "ov":true,
            "value":"FirstName 1",
            "uri":"entities/0001L5U/attributes/FirstName/1n5QlE"
         }
      ]
   },
   "isFavorite":false,
   "crosswalks":[
      {
         "uri":"entities/0001L5U/crosswalks/1n5ZHk",
         "type":"configuration/sources/FB",
         "value":"entity1",
         "reltioLoadDate":"2016-04-01T18:32:55.267+05:00",
         "createDate":"2016-04-01T18:32:55.267+05:00",
         "updateDate":"2016-04-01T18:32:55.267+05:00",
         "attributes":[
            "entities/0001L5U/attributes/FirstName/1n5QlE"
         ],
         "singleAttributeUpdateDates":{

         }
      }
   ],
   "label":"Value2 LastName1",
   "secondaryLabel":""
}

Insert New Attribute With preserverURIs by the Entity URI


POST {tenantUrl}/entities?options=preserveURIs
  
[
  {
    "uri": "entities/0001L5U",
    "type": "configuration/entityTypes/HCP",
    "attributes": {
      "LastName": [
        {
          "value": "LastName 1"
        }
      ]
    },
    "crosswalks": [
      {
        "type": "configuration/sources/FB",
        "value": "entity2"
      }
    ]
  }
]

In this case, the match entity is found by the URI, and the new attribute is inserted into it.

Results

{
   "uri":"entities/0001L5U",
   "type":"configuration/entityTypes/HCP",
   "createdBy":"test.user",
   "createdTime":1459517575267,
   "updatedBy":"test.user",
   "updatedTime":1459987315924,
   "attributes":{
      "FirstName":[
         {
            "type":"configuration/entityTypes/HCP/attributes/FirstName",
            "ov":true,
            "value":"FirstName 1",
            "uri":"entities/0001L5U/attributes/FirstName/1n5QlE"
         }
      ],
      "LastName":[
         {
            "type":"configuration/entityTypes/HCP/attributes/LastName",
            "ov":true,
            "value":"LastName 1",
            "uri":"entities/0001L5U/attributes/LastName/1n5QXX"
         }
      ]
   },
   "isFavorite":false,
   "crosswalks":[
      {
         "uri":"entities/0001L5U/crosswalks/1n5ZHk",
         "type":"configuration/sources/FB",
         "value":"entity1",
         "reltioLoadDate":"2016-04-01T18:32:55.267+05:00",
         "createDate":"2016-04-01T18:32:55.267+05:00",
         "updateDate":"2016-04-01T18:32:55.267+05:00",
         "attributes":[
            "entities/0001L5U/attributes/FirstName/1n5QlE"
         ],
         "singleAttributeUpdateDates":{

         }
      },
      {
         "uri":"entities/0001L5U/crosswalks/1n5ZLd",
         "type":"configuration/sources/FB",
         "value":"entity2",
         "reltioLoadDate":"2016-04-02T19:37:55.267+05:00",
         "createDate":"2016-04-02T19:37:55.267+05:00",
         "updateDate":"2016-04-02T19:37:55.267+05:00",
         "attributes":[
            "entities/0001L5U/attributes/FirstName/1n5QXX"
         ],
         "singleAttributeUpdateDates":{

         }
      }
   ],
   "label":"Value2 LastName1",
   "secondaryLabel":""
}

Example 2. Attributes URIs in the Request

URIs of attribute values can be changed during overwrite operation (of an attribute has more than one value and at least one of values were changed). As you can see in the partialOverride option example, the URI of the value of the FirstName attribute was changed after overwrite.

If the preserveURIs option is present for simple or nested attributes, URIs of attribute values for which they were specified in the request JSON will not be changed. This option does not work with reference attributes.

Existing Entity

{
   "uri":"entities/0001L5U",
   "type":"configuration/entityTypes/HCP",
   "createdBy":"test.user",
   "createdTime":1459517575267,
   "updatedBy":"test.user",
   "updatedTime":1459517575267,
   "attributes":{
      "FirstName":[
         {
            "type":"configuration/entityTypes/HCP/attributes/FirstName",
            "ov":true,
            "value":"Value2",
            "uri":"entities/0001L5U/attributes/FirstName/1n5QlE"
         },
         {
            "type":"configuration/entityTypes/HCP/attributes/FirstName",
            "ov":true,
            "value":"Value1",
            "uri":"entities/0001L5U/attributes/FirstName/1n5MUy"
         }
      ]
   },
   "isFavorite":false,
   "crosswalks":[
      {
         "uri":"entities/0001L5U/crosswalks/1n5ZHk",
         "type":"configuration/sources/FB",
         "value":"entity1",
         "reltioLoadDate":"2016-04-01T18:32:55.267+05:00",
         "createDate":"2016-04-01T18:32:55.267+05:00",
         "updateDate":"2016-04-01T18:32:55.267+05:00",
         "attributes":[
            "entities/0001L5U/attributes/FirstName/1n5QlE",
            "entities/0001L5U/attributes/FirstName/1n5MUy"
         ],
         "singleAttributeUpdateDates":{

         }
      }
   ],
   "label":"Value2 LastName1",
   "secondaryLabel":""
}

Overwrite With preserveURIs Option for Attributes

POST {tenantUrl}/entities?options=preserveURIs
  
[
  {
    "type": "configuration/entityTypes/HCP",
    "attributes": {
      "FirstName": [
        {
          "value": "Value1New",
          "uri": "entities/0001L5U/attributes/FirstName/1n5QlE"
        }
      ]
    },
    "crosswalks": [
      {
        "type": "configuration/sources/FB",
        "value": "entity1"
      }
    ]
  }
]

In this case, the match entity is found by the crosswalk, and the URI of the attribute value has not changed.

Results

{
   "uri":"entities/0001L5U",
   "type":"configuration/entityTypes/HCP",
   "createdBy":"test.user",
   "createdTime":1459517575267,
   "updatedBy":"tgest.user",
   "updatedTime":1459517956024,
   "attributes":{
      "FirstName":[
         {
            "type":"configuration/entityTypes/HCP/attributes/FirstName",
            "ov":true,
            "value":"Value1New",
            "uri":"entities/0001L5U/attributes/FirstName/1n5QlE"
         }
      ]
   },
   "isFavorite":false,
   "crosswalks":[
      {
         "uri":"entities/0001L5U/crosswalks/1n5ZHk",
         "type":"configuration/sources/FB",
         "value":"entity1",
         "reltioLoadDate":"2016-04-01T18:39:16.024+05:00",
         "createDate":"2016-04-01T18:32:55.267+05:00",
         "updateDate":"2016-04-01T18:32:55.267+05:00",
         "attributes":[
            "entities/0001L5U/attributes/FirstName/1n5QlE"
         ],
         "singleAttributeUpdateDates":{

         }
      }
   ],
   "label":"Value1New",
   "secondaryLabel":""
}