Loading...

Put Object Metadata

Description

This API allows you to add metadata for the required object stored in a bucket. The Bucket is referred by its unique bucket name, and the required object is referred using its name.

Note:

  • You can use alphanumeric, underscores, or whitespace characters, as well as hyphens, to write your metadata. No other special character is allowed other than the once mentioned.

  • You can fetch the metadata of an object using the HEAD request method. In the response, the metadata will be listed in the key ‘x-user-meta’.

  • The maximum size limit of characters allowed for the overall metadata is 2047 characters. The character count used to determine the size limit also includes the colon “:” special character used to define the key value pair.

Request Details

Request URL

POST

{api-domain}/baas/v1/project/{project_id}/bucket/object/metadata

copy

project_id
Numerical
The unique ID of the project

Request JSON

You must send a JSON with its corresponding values as shown below.

Sample Payload
copy
{
"meta_data": {
    "key1": "value1",
    "key2": "value2"
}
}
View more

You will feed this Request JSON to your Request Body, and you need to provide the value of:

meta_data
mandatory
This JSON will contain the required meta data in the form of JSON key value pairs.

Query Parameters

bucket_name Alphanumeric
mandatory
object_key String
mandatory
Will contain the complete name of the object.

Request Headers

Authorization: Zoho-oauthtoken {oauth_token}

Optional Headers

CATALYST-ORG: {org_id}

Environment: Development

Scope

ZohoCatalyst.buckets.objects.CREATE

Response Details

On successful execution, the response will contain the success message indicating that the metadata has been added to the required object.

Sample Request
copy

curl -X PUT https://api.catalyst.zoho.com/baas/v1/project/10108000003823392/bucket/object/metadata?bucket_name=myBucketName&object_key=image2.png/ -H “Authorization: Zoho-oauthtoken 1000.910*************************16.2f*************************57” -H “Content-Type:application/json” --data-raw $’{"{“meta_data” : {“key1” : “value1”,“key2” : “value2”}}"}'

Sample Response
copy
{
"status": "success",
"data": {
    "message": "Metadata added successfully"
}
}
View more