Publishing a File without Expiration

To publish a file without expiration, use the following command. The URL will remain valid and the file will be accessible forever.

curl -v -X POST \
  -H "Authorization: Bearer {ACCESS_TOKEN}" \
  -H "Content-Type: application/vnd.kii.ObjectBodyPublicationRequest+json" \
  -H "Accept: application/vnd.kii.ObjectBodyPublicationResponse+json" \

Kii Cloud returns a respond like the following example.

< 201
< Expires: Wed, 14 Aug 2013 06:59:27 GMT
< Content-Type: application/vnd.kii.ObjectBodyPublicationResponse+json

  "publicationID" : {PUBLICATION_ID},
  "url" : "{PUBLICATION_ID}"

The URL for accessing the object body is included in the response body.

Note that a user needs to be permitted the READ_EXISTING_OBJECT action on a KiiObject to publish its object body (Once published, anyone can access the object body with the URL). See Setting a KiiObject's ACL for more information about the access rights.