Bucket of default type

Location /api/apps/{appID}/things/{thingID}/buckets/{bucketID}

Access a bucket of the default type. This is equivalent to accessing this resource with default:{bucketID}.

A bucketID can have letters (a-z, A-Z), numbers (0-9), underscore(_), and hyphen (-). Its length must be between 2 and 64 characters. The following names are not allowed: "devices", "users", "installations", "internal", and "things".

Request Headers (Applies to all methods)

Authorization
header
Required: Yes

GET

/api/apps/{appID}/things/{thingID}/buckets/{bucketID}

Description

Retrieve a bucket information.

Security

The administrator can execute this action. For other users, the permission to execute this action is determined by the ACL set on the scope (application, user, group, or thing) in which the bucket belongs.

Headers
Name Required? type Description
Authorization Yes string Authorization can be of type Basic or Bearer.
  • Authorization Basic: header for granting an anonymous access.
    • Set a Base64-encoded string of AppID and AppKey concatenated with a colon (APP_ID:APP_KEY).
    • The header should look like:
      Authorization: Basic czZCaGRSa3F0Mzo3RmpmcDBaQnIxS3REUmJuZlZkbUl3
  • Authorization Bearer: using Oauth2 Bearer Token.
    • The header should look like:
      Authorization: Bearer ht5fpHQAyrPPwLftK1rAqllv5WNVPCnYfPiCvPocFuQ
URL Params
Name Required? type Description
bucketID Yes string The ID of the bucket.
Responses
200

Content-Type application/vnd.kii.BucketRetrievalResponse+json

The bucket information has been retrieved successfully.
Contents
Name Type Description
bucketType BucketType The type of the bucket.
size int The number of objects in the bucket.
404

Content-Type application/vnd.kii.ThingNotFoundException+json

The thing was not found.
Contents
Name Type Description
errorCode string Error code "THING_NOT_FOUND".
message string The error message.
field string The field used for searching the thing. This can be the "thingID" or "vendorThingID" field.
value string The field value used for searching the thing.
appID string The ID of the application.
404

Content-Type application/vnd.kii.BucketNotFoundException+json

The bucket was not found.
Contents
Name Type Description
errorCode string Error code "BUCKET_NOT_FOUND".
message string The error message.
objectScope ObjectScope The scope of the bucket.
appID string The ID of the application.
userID string The ID of the user. Only provided for a user-scope bucket.
groupID string The ID of the group. Only provided for a group-scope bucket.
thingID string The ID of the thing. Only provided for a thing-scope bucket.
type string One of "APP", "APP_AND_USER", "APP_AND_GROUP", or "APP_AND_THING".
bucketID string The ID of the bucket.
401

Content-Type application/vnd.kii.UnauthorizedAccessException+json

Not authorized to get bucket information.
Contents
Name Type Description
errorCode string Error code "UNAUTHORIZED".
message string The error message.
authenticatedAppID string The authenticated appID.
authenticatedPrincipalID string The authenticated principal ID (userID or thingID).

HEAD

/api/apps/{appID}/things/{thingID}/buckets/{bucketID}

Description

Verify if a bucket exists

Security

The administrator can execute this action. For other users, the permission to execute this action is determined by the ACL set on the scope (application, user, group, or thing) in which the bucket belongs.

Headers
Name Required? type Description
Authorization Yes string Authorization can be of type Basic or Bearer.
  • Authorization Basic: header for granting an anonymous access.
    • Set a Base64-encoded string of AppID and AppKey concatenated with a colon (APP_ID:APP_KEY).
    • The header should look like:
      Authorization: Basic czZCaGRSa3F0Mzo3RmpmcDBaQnIxS3REUmJuZlZkbUl3
  • Authorization Bearer: using Oauth2 Bearer Token.
    • The header should look like:
      Authorization: Bearer ht5fpHQAyrPPwLftK1rAqllv5WNVPCnYfPiCvPocFuQ
URL Params
Name Required? type Description
bucketID Yes string The ID of the bucket.
Responses
204

Content-Type (None)

The bucket exists.
Note This response has no contents.
404

Content-Type (None)

The bucket does not exist.
401

Content-Type (None)

Not authorized to check if the bucket exists.

DELETE

/api/apps/{appID}/things/{thingID}/buckets/{bucketID}

Description

Delete a bucket and its content.

Security

The administrator can execute this action. For other users, the permission to execute this action is determined by the ACL set on the scope (application, user, group, or thing) in which the bucket belongs.

Headers
Name Required? type Description
Authorization Yes string Authorization can be of type Basic or Bearer.
  • Authorization Basic: header for granting an anonymous access.
    • Set a Base64-encoded string of AppID and AppKey concatenated with a colon (APP_ID:APP_KEY).
    • The header should look like:
      Authorization: Basic czZCaGRSa3F0Mzo3RmpmcDBaQnIxS3REUmJuZlZkbUl3
  • Authorization Bearer: using Oauth2 Bearer Token.
    • The header should look like:
      Authorization: Bearer ht5fpHQAyrPPwLftK1rAqllv5WNVPCnYfPiCvPocFuQ
URL Params
Name Required? type Description
bucketID Yes string The ID of the bucket.
Responses
204

Content-Type (None)

The bucket has been deleted successfully.
Note This response has no contents.
404

Content-Type application/vnd.kii.ThingNotFoundException+json

The thing was not found.
Contents
Name Type Description
errorCode string Error code "THING_NOT_FOUND".
message string The error message.
field string The field used for searching the thing. This can be the "thingID" or "vendorThingID" field.
value string The field value used for searching the thing.
appID string The ID of the application.
404

Content-Type application/vnd.kii.BucketNotFoundException+json

The bucket was not found.
Contents
Name Type Description
errorCode string Error code "BUCKET_NOT_FOUND".
message string The error message.
objectScope ObjectScope The scope of the bucket.
appID string The ID of the application.
userID string The ID of the user. Only provided for a user-scope bucket.
groupID string The ID of the group. Only provided for a group-scope bucket.
thingID string The ID of the thing. Only provided for a thing-scope bucket.
type string One of "APP", "APP_AND_USER", "APP_AND_GROUP", or "APP_AND_THING".
bucketID string The ID of the bucket.
401

Content-Type application/vnd.kii.UnauthorizedAccessException+json

Not authorized to delete the bucket.
Contents
Name Type Description
errorCode string Error code "UNAUTHORIZED".
message string The error message.
authenticatedAppID string The authenticated appID.
authenticatedPrincipalID string The authenticated principal ID (userID or thingID).