Getting a KiiObject

There are two methods to get KiiObjects on Kii Cloud: getting a specific KiiObject by URL and getting a bunch of KiiObjects that meet a condition within a bucket by querying KiiObjects.

Either method allows you to get data by referencing a JSON document in an obtained KiiObject.

By saving the ID or entire URI of a created KiiObject, you can get the KiiObject with the saved ID or URL later.

This topic explains how to get a KiiObject by ID. Note that the KiiObject ID is unique only within a bucket.

curl -v -X GET \
  -H "Authorization: Bearer {ACCESS_TOKEN}" \
  "https://api-jp.kii.com/api/apps/{APP_ID}/users/me/buckets/{BUCKET_ID}/objects/{OBJECT_ID}"

Kii Cloud will return the KiiObject as a response, as shown in the following example. The created and modified times are in UNIX time (msec, UTC):

< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< Last-Modified: Tue, 15 May 2012 00:03:03 GMT
< ETag: "3"
< Content-Type: application/vnd.{APP_ID}.mydata+json
< Transfer-Encoding: chunked
< Date: Tue, 15 May 2012 00:07: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"}