Update a Key-Value Pair
Description
This API enables you to update a key-value pair in a cache segment. The segment is referred by its unique ID. The key represents the attribute and the value is the data of the cache item.
You can update the key, value, or the time of expiry of the cache item. The default and maximum validity of a cache item is two days.
Request URL
https://api.catalyst.zoho.com/baas/v1/project/{project_id}/segment/{segment_id}/cache
project_id - The unique ID of the project
segment_id - The unique ID of the cache segment
Request Headers
Authorization: Zoho-oauthtoken 1000.910***************************16.2f****************************57
Content-Type: application/json
Request Method
PUT
Scope
scope=ZohoCatalyst.cache.CREATE
Request JSON Properties
| Attributes | Data Type | Mandatory | Max Size | Description |
|---|---|---|---|---|
| cache_name | String | Yes | 50 characters | Key name of the cache segment |
| cache_value | String | Yes | 16000 characters | Data value the key represents |
| expiry_in_hours | Long | No | 48 | Duration of expiry in hours |
SDK documentation
Sample Request
curl -X PUT \
https://api.catalyst.zoho.com/baas/v1/project/4000000006007/segment/3376000000425030/cache \
-H “Authorization: Zoho-oauthtoken 1000.910***************************16.2f****************************57" \
-H “Content-Type:application/json" \
-d ‘{
“cache_name”:”counter”,
”cache_value”:”1472”
}’ Sample Response
{
"status": "success",
"data": {
"cache_name": "counter",
"cache_value": "1472",
"project_details": {
"id": 4000000006007,
"project_name": "ShipmentTracking"
},
"segment_details": {
"id": 3376000000425030,
"segment_name": "CounterValues"
},
"expires_in": "Mar 28, 2019 02:03 AM",
"expiry_in_hours": 7
}
}