Update Entity Operation

The update entity operation replaces property values in an existing entity.

HTTP POST URL Format

The request is specified as follows. The Spectrum server supports both HTTP and HTTPS.

POST http://server_name:port/rest/DataHub/operations/modelName/entities/entityType/entityLabel

URL Path Elements

modelName
The name of the Context Graph model.
entityType
An entity type defined in the model
entityLabel
The label for an existing entity.

URL POST Body Format

Content-Type:application/json {Property Name-Value Pairs}

You can specify a property name and value pair for any existing property in the following format:

{
    "Property1":"Value1",
    "Property2":"Value2",
    ...
}

At least one property is required to successfully complete the operation. Omitted properties will not be changed.

Response

The operation returns the status code "200 OK" when it is successful. The operation returns the status code 500 (Error) when it fails.

Update entity with JSON response

The following request updates property values for the "Place" entity type in the "911" model with the label "FlightSafety International".

POST http://localhost:8080/rest/DataHub/operations/911/entities/Place/FlightSafety%20International

Body:

{
    "Latitude":"27.6386433",
    "Location":"Vero Beach, Florida",
    "Longitude":"-80.39727",
    "Place":"FlightSafety International",
    "Date":1275782400000
    }            
Note: Date, time, and date-time property values are UNIX Epoch time values formatted as long data type in both requests and responses.

Response:

{
    "success":"200 OK"
}