POST - Update resource
Purpose
This API helps in updating a resource added to resource booking. The resourceId in the Request URL given below can be fetched using the Get all resources API.
Request URL
https://calendar.zoho.com/api/v1/resources/<resourceId>
OAuth Scope
scope=ZohoCalendar.resources.ALL
or
scope=ZohoCalendar.resources.UPDATE
ALL - Access all resources.
UPDATE - Updates a resource
Request Parameters
- resourceDataJSONObject, mandatory
- The resourceData has the values of key parameters like resource name, its type, category, etc., as ResourceJson.
- ResourceJson:
- resource_namestring, mandatory
- The resource name (room name) should be mentioned while adding it.
- Example: Conference Hall, Testing room.
- capacityint, optional
- The room's capacity can be given in numbers. As we have enabled only the addition of rooms to resources, the room's capacity to hold the number of people should be given while adding it to resource booking.
- resource_typeint, mandatory
- Allowed values:
- 0 for Rooms,
- 1 and 2 for other resources (Support not provided at present)
- Allowed values:
- categoryint, optional
- The rooms are classified into:
- 0 for Meeting Room
- 1 for Conference Room
- 2 for Training Room
- 3 for Other type of rooms
- The rooms are classified into:
- branch_idlong, mandatory
- The branch ID to which the resource should be added can be fetched by using the Get Branch list API.
- building_idlong, mandatory
- The building ID to which the resources should be added can be fetched by using the Get Branch list/ Get Branch info API.
- floor_idlong, mandatory
- The floor ID to which the resource should be added can be fetched by using the Get Branch info API.
- descriptionstring, optional
- A description of the resource can be given.
- featuresJSONArray, optional
- The ResFeatureJson consists of the feature id and feature value. This parameter can be used if you want to map features to the resources you add to a branch. The key parameters within the JSON are mandatory when you map a feature.
- ResFeatureJson:
- feature_idlong, mandatory
- The feature ID is fetched using the Get Feature List API.
- You can add features using the Add features API.
- feature_valuestring, mandatory
- The feature value is given based on the feature type that has been added while adding a feature using the Add feature (POST) API.
- Feature type - 0: The value "1" denotes that the feature is added based on availability.
- Feature type - 1: The numbers are given based on the count of the feature availability.
- Feature type - 2: The names or string is given based on the string value given for the feature.
- image_namestring, optional
- The name for the image added should be given here.
- is_hiddenboolean, optional
- The boolean value "true" denotes that the resource is not visible to the users. If the value is "false" the resource will be visible to the users.
- rem_feat_idsJSONArray, optional
- This is a string array of the feature IDs that need to be removed from the updated resource. The feature IDs can be fetched using the Get all features API.
- photoimage, optional
- The image file of the resource can be attached while adding a resource to resource booking.
- The supported formats of image are .png, .jpg, .jpeg.
- Maximum size - 10 MB.
Sample Request
Copiedhttps://calendar.zoho.com/api/v1/resources/1596625240531000001?resourceData={"resource_name":"Test room edit","branch_id":"1594972463960000001","capacity":"12","resource_type":"0","category":"1"}Sample Response
Copied{
"building_id":"1594972463962000002",
"category_name":"Conference Room",
"resource_type":0,
"is_hidden":false,
"res_email_id":"5ddde382c3c640de9ecb5c44e654379d@m43.com",
"resource_approval":false,
"auto_gen_name":"5ddde382c3c640de9ecb5c44e654379d",
"capacity":12,
"is_available":true,
"has_image":false,
"branch_id":"1594972463960000001",
"resource_id":"1596625240531000001",
"floor_id":"1594972463966000003",
"resource_name":"Test room edit",
"category":1
}Error message: Unsupported image format
Copied{
"errorcode": "UNMATCHED_FILE_CONTENT_TYPE",
"status": "error"
}