Loading...

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

PUT

{bucket_name}.zohostratus.com/{key}

copy

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
Note: If the API is used in the development environment, then the domain will be structured in this manner: https://<bucket_name>-development.zohostratus.com

Path Parameters

project_id
Numerical
The unique ID of the project

bucket_name
String

key
String
The name of the object that needs to be uploaded

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

version_id String
optional
This is an ID generated by Stratus when Versioning is enabled. You can use version_id to refer to the required object.

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:

Failure Response
copy
{
"status": 404,
"code": "bucket_not_found",
"message": "no such bucket exists"
}
View more

403 Unauthorized. When you do not have the required permissions to perform the upload operation

Failure Response
copy
{
"status": 403,
"code": "access_forbidden",
"message": "request denied by resource access policy"
}
View more

400 Bad Request. Invalid Filename

Failure Response
copy
{
"status": 400,
"code": "key_name_invalid",
"message": "key name does not support one or more character(s)"
}
View more

409 Conflict. An object with the same name already exists

Failure Response
copy
{
"status": 409,
"code": "key_already_exists",
"message": "key is already associated with another object in the bucket"
}
View more
Sample Request
copy

curl -X PUT https://{bucket_name}.zohostratus.com/{key} -H “Authorization: Zoho-oauthtoken 1000.910*************************16.2f*************************57”

Sample Response
copy

200 OK

View more