Upload Object
Description
This API allows you to upload the required object to a bucket. The Bucket is referred by its unique bucket name, and the required object is referred using its name.
Request Details
Request URL
{bucket_name}.zohostratus.com/{key}
The above domain name will change with respect to the data center:
| DC | Domain Name |
|---|---|
| US | zohostratus.com |
| EU | zohostratus.eu |
| IN | zohostratus.in |
| AU | zohostratus.com.au |
| CA | zohostratus.ca |
| SA | zohostratus.sa |
| JP | zohostratus.jp |
Path Parameters
Note: The following points need to be kept in mind when providing value for key:
-
Maximum length of the key (including path name and object name) should be supported to 255 characters only.
-
key cannot contain the following characters including space: double quote, both angular brackets, hashtag, backward slash and pipe symbol.
Query Parameters
Request Headers
Authorization: Zoho-oauthtoken {oauth_token}
Optional Headers
content-type: application/json
content-length: Raw length of the object being uploaded in bytes.
compress: Whether to compress the object while storing. By default, compression is always done.
cache-control: Use this header to specify the browser caching policies.
overwrite: Specify whether you are required to overwrite a source. This is supported only for the objects of non-versioned buckets.
expires-after: This is an option you can use to set Time-to-Live (TTL) in seconds for an object. Value should be greater than or equal to 60 seconds.
x-user-meta:{1stKey}={1stValue};{2ndKey}={2ndValue};..{NthKey}={NthValue};: Metadata for the object. Each key-value pair is separated by semi-colons are provided as given in the previous column. 2047 characters is the maximum permitted length for this header.
Scope
Stratus.fileop.CREATE
Response Details
On successful execution, the response will contain the success message, and the object will be uploaded.
Possible Failure Responses
404 due to object/bucket not found:
{
"status": 404,
"code": "bucket_not_found",
"message": "no such bucket exists"
}
403 Unauthorized. When you do not have the required permissions to perform the upload operation
{
"status": 403,
"code": "access_forbidden",
"message": "request denied by resource access policy"
}
400 Bad Request. Invalid Filename
{
"status": 400,
"code": "key_name_invalid",
"message": "key name does not support one or more character(s)"
}
409 Conflict. An object with the same name already exists
{
"status": 409,
"code": "key_already_exists",
"message": "key is already associated with another object in the bucket"
}
curl -X PUT https://{bucket_name}.zohostratus.com/{key}
-H “Authorization: Zoho-oauthtoken 1000.910*************************16.2f*************************57”
200 OK
Yes
No
Send your feedback to us