PUT /api/kps/{storeAlias}/{objectId}

Description

Creates or updates an object.
The primary ID is specified in the request.
If the server generates the primary ID then the POST method should be used.

For object creation, both the primary ID and the secondary ID (if defined) must be specified.
For object update, the primary ID must be specified.
Other properties are optional.

To update a property specify its new value.
To delete a property set the value to null.
It is not currently possible to partially update a Map or a List property.
All properties of the Map or List must be specified for this case.


Resource URL

https://localhost:8090/api/router/service/api-server-instance-id/api/kps/{storeAlias}/{objectId}


Parameters

storeAlias mandatory Alias of store to create or update object in.
objectId mandatory Primary object identifier.
object mandatory Object data which is passed in the request body. The object id MUST also be specified in the object body. To create a new object with a server-generated id, use the POST method instead.

Responses

Response Code Description
201 Success. Object did not exist and was created. The response body is empty.
204 Success. Object existed and was updated. The response body is empty.
404 Fail. KPS has not been configured on this node.
404 Fail. The specified store or object does not exist.
500 Fail. An internal server error occurred.

Example Request and Response

PUT https://localhost:8090/api/router/service/instance-1/api/kps/employees/0001

{
    "id": "0001",
    "name": "fred",
    "email": "fred@vordel.com",
    "age": 35
}

Via CURL: curl -k -v --header "Content-Type:application/json" --user admin:changeme -X PUT -d ' { "id" : "0001", "name" : "fred", "email": "fred@vordel.com", "age" : 35 } ' https://localhost:8090/api/router/service/instance-1/api/kps/employees/0001

HTTP 1.1 201 Created