Request Headers (Applies to all methods)
POST
/api/apps/{appID}/users/me/buckets/{bucketID}/objects/{objectID}/body/publish
Publish the object body and get its URL.
The administrator can execute this action. For other users, the permission to execute this action is determined by the ACL set on the object. This action requires the read permission.
Content-Type application/vnd.kii.ObjectBodyPublicationRequest+json
You can set an expiration time on the published object body. The expiration time can be set with the parameter "expiresAt" or "expiresIn". You can set only one of them.
- 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
{
"expiresAt": "[long]",
"expiresIn": "[int]"
}
Content-Type application/vnd.kii.ObjectBodyPublicationResponse+json
Name | Type | Description |
---|---|---|
publicationID | string | The ID of the publication |
url | string | The URL to access the published content |
Content-Type application/vnd.kii.UserNotFoundException+json
Name | Type | Description |
---|---|---|
errorCode | string | Error code "USER_NOT_FOUND". |
message | string | The error message. |
field | string | The field used for searching the user. This can be the userID or address field. |
value | string | The field value used for searching the user. |
appID | string | The ID of the application. |
Content-Type application/vnd.kii.ObjectNotFoundException+json
Name | Type | Description |
---|---|---|
errorCode | string | Error code "OBJECT_NOT_FOUND". |
message | string | The error message. |
objectScope | ObjectScope | The scope of the object. |
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. |
objectID | string | The ID of the object that was not found. |
Content-Type application/vnd.kii.ObjectBodyNotFoundException+json
Name | Type | Description |
---|---|---|
errorCode | string | Error code "OBJECT_BODY_NOT_FOUND". |
message | string | The error message. |
objectScope | ObjectScope | The scope of the object. |
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. |
objectID | string | The ID of the object that does not have body. |
Content-Type application/vnd.kii.UnauthorizedAccessException+json
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). |