Deleting a KiiObject

You can delete a KiiObject by calling the kii_object_delete function.

/* Set the KiiObject ID. */

/* Set bucket parameters. */
kii_bucket_t bucket;
memset(&bucket, 0x00, sizeof(kii_bucket_t));
bucket.scope = KII_SCOPE_THING;
bucket.bucket_name = "myBucket";
bucket.scope_id = "VENDOR_THING_ID:rBnvSPOXBDF9r29GJeGS";

/* Delete the KiiObject. */
ret = kii_object_delete(&kii, &bucket, OBJECT_ID);
if (ret != 0) {
  /* Handle the error. */

Specify the target bucket with the kii_bucket_t structure. See Creating a KiiObject to learn how to specify it.

If you delete a KiiObject which has an object body, the body will be deleted at the same time. If the object body has been published, its URL will be disabled too.

Although there is no API for bulk-deleting multiple KiiObjects, you can delete all KiiObjects in a bucket at once by deleting the bucket using the REST API or mobile apps. See Deleting a Bucket for more details.