POST /api/kps/{storeAlias}
Description
Creates an object where the the object id (primary key) is auto-generated on the server side.
For client generated object id please use the PUT method.
If a secondary key is defined for the store, values must be provided for all of its constituent properties.
Other property values are optional.
Resource URL
https://localhost:8090/api/router/service/api-server-instance-id/api/kps/{storeAlias}
Parameters
storeAlias | mandatory | Alias of store to create object in. |
object | mandatory | Object data which is passed in the request body. The object id is NOT specified in the object body. This is generated on the server side. If the object id is generated on the client then use the PUT method. |
Responses
Response Code | Description |
---|---|
201 | Success. The response body contains the auto-generated id of the new object. The Location header in the HTTP response also contains this id. |
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
POST https://localhost:8090/api/router/service/instance-1/api/kps/employees
{
"name": "fred",
"email": "fred@vordel.com",
"age": 35
}
Via CURL: curl -k -v --header "Content-Type:application/json" --user admin:changeme -X POST -d ' { "name" : "fred", "email": "fred@vordel.com", "age" : 35 } ' https://localhost:8090/api/router/service/instance-1/api/kps/employees
HTTP/1.1 201 Created
Location: /api/kps/employees/2705271d-bba2-49d9-82a9-8d71e18477b6
[
{
"id": "2705271d-bba2-49d9-82a9-8d71e18477b6"
}
]