POST - Add resource
Purpose
This API helps in adding a new resource. As for now, API support is given only for the addition of rooms to Resource Booking. The support for the addition of other resources will be available soon.
Request URL
https://calendar.zoho.com/api/v1/resources
OAuth Scope
scope=ZohoCalendar.resources.ALL
or
scope=ZohoCalendar.resources.CREATE
ALL - Access to all resources
CREATE - Creates 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.
- 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?resourceData={"resource_name":"Testroom","branch_id":"1594972463960000001","building_id":"1594972463962000002","floor_id":"1594972463966000003","capacity":"123","resource_type":"0","category":"0"}Sample Response
Copied{
"building_id":"1594972463962000002",
"category_name":"MeetingRoom",
"resource_type":0,
"is_hidden":false,
"res_email_id":"5ddde382c3c640de9ecb5c44e654379d@m43.com",
"resource_approval":false,
"auto_gen_name":"5ddde382c3c640de9ecb5c44e654379d",
"capacity":123,
"is_available":true,
"has_image":false,
"branch_id":"1594972463960000001",
"resource_id":"1596625240531000001",
"floor_id":"1594972463966000003",
"resource_name":"Test room",
"category":0
}Error message: Unsupported image formats
Copied{
"errorcode": "UNMATCHED_FILE_CONTENT_TYPE",
"status": "error"
}