Partial Update without the Overwrite Check
This method merges the data on the server with the key-value pairs sent from the client. You will send only key-value pairs you want to update from the client to the server. Note that you cannot delete the keys on the server with this method.
The data will be overwritten unconditionally regardless of if the data on the server has been updated by other clients.
Here is the sample code:
curl -v -X POST \
-H "Authorization: Bearer {ACCESS_TOKEN}" \
-H "X-HTTP-Method-Override: PATCH" \
"https://api-jp.kii.com/api/apps/{APP_ID}/users/me/buckets/{BUCKET_ID}/objects/{OBJECT_ID}" \
-d '{"score": 5000}'
Notice that "X-HTTP-Method-Override: PATCH" header is sent. This header makes the KiiObject updated partially.
If the KiiObject is partially updated, Kii Cloud will return a response like the following with the created and modified time in UNIX time (msec) in UTC.
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< ETag: "3"
< Content-Type: application/vnd.{APP_ID}.mydata+json
< Transfer-Encoding: chunked
< Date: Tue, 15 May 2012 00:03:03 GMT
<
{
"score":5000,
"name":"game1",
"_created":1337039114613,
"_id":"d8dc9f29-0fb9-48be-a80c-ec60fddedb54",
"_modified":1337040183711,
"_owner":"ff43674e-b62c-4933-86cc-fd47bb89b398",
"_dataType":"mydata",
"_version":"3"
}
The score
field now has a value of 5000.