POST - Update branch with building and floors
Purpose
This API is used to update the details of existing branch info in Resource Booking. You can update the branch name, building, and floor information using the API given below.
You can also remove buildings and floors from the branches by providing the building and floor IDs. You can fetch the building and floor IDs using the GET Branch details API.
Request URL
https://calendar.zoho.com/api/v1/branches/<branchId>
OAuth Scope
scope=ZohoCalendar.branches.ALL
or
scope=ZohoCalendar.branches.UPDATE
ALL - Full access to all branches
UPDATE - Updates branch info in Resource Booking
Path Parameters
- branchIdlong, mandatory
- The branch ID in which the building or floor needs to be updated.
Request Parameters
- branchDataJSONObject, mandatory
- branchData is a mandatory JSONObject that will have the values of branch name, work start, and end hours, block floor info, and so on as BranchBuildingJson.
- BranchBuildingJson:
- branch_namestring, optional
- The branch name denotes the name of the different locations of your organization.
- work_start_hourstring, optional
- The start of your work timings. Denote it in 12 hours time format.
- Provide am and pm along with the time.
- Supported format: hh:mm a
- Example: 05:00 am, 06:00 pm, 12:00 am, 12:00 pm.
- work_end_hourstring, optional
- The end of your work timings. Denote it in 12 hours time format.
- Provide am and pm along with the time.
- Supported format: hh:mm a
- Example: 05:00 am, 06:00 pm, 12:00 am, 12:00 pm.
- work_start_dayint, optional
- It denotes the start day of your workweek.
- The days are assigned with numbers from 0 to 6. (i.e.,) Sun - 0, Mon - 1, ..., Fri - 5, Sat - 6.
- work_end_dayint, optional
- It denotes the end day of your workweek.
- The days are assigned with numbers from 0 to 6. (i.e.,) Sun - 0, Mon - 1, ..., Fri - 5, Sat - 6.
- blk_flr_infoJSONArray, optional
- The block floor info is a JSONArray containing the values of the BuildingJson. The values of the BuildingJson are given below.
- BuildingFloorJson:
- building_idlong, mandatory
- building_id will be generated for each building you add to Resource Booking. You can also fetch the building_id using the Get branches API.
- This need to be given when a building is updated and not when new buildings are added.
- building_namestring, mandatory
- You can give names to the buildings that you add to resource booking.
- floor_countint, optional
- The floor count is the number of floors that you have in a particular building that you add to resource booking.
- You can use the integer values starting from 1.
- floors JSONArray, optional
- The floors info is a JSONArray consisting of the values from the FloorJson. The values of the FloorJson are given below.
- FloorJson:
- floor_idlong, optional
- floor_id will be generated for each floor you add to a building. You can also fetch the floor_id using the Get branches API.
- This need to be given when a floor is updated and not when new floors are added.
- floor_namestring, mandatory
- Floor names can be given to the floors that are available in a building that you add in Resource Booking.
- Example: Ground Floor, Floor - 1, Mezzanine, Terrace.
- floor_orderint, optional
- The floor order is the value that is assigned to each floor you add to a building.
- The floors will be listed based on the number you give to each floor.
- The floor with the floor order "1" will be listed at the top, followed by the floor orders of increasing integer values starting from 1.
- rem_blk_idsJSONArray, optional
- This is the string array for the building IDs that need to be removed from the branch.
- rem_flr_infoJSONArray, optional
- This is the JSON containing the floors' information that should be removed from a block/ building. The remFloorJson will have the values of floor ID and floor information that need to be removed as given below:
- remFloorJson:
- building_idlong, mandatory
- The remove floor info parameter has the values of building IDs and floor IDs that need to be removed from a branch.
- rem_flr_idsJSONArray, mandatory
- The floor IDs as string array that need to be removed are mentioned in this parameter.
- time_zonestring, optional
- Mention the time zone in which the organization is located.
Sample Request
Copiedhttps://calendar.zoho.com/api/v1/branches/1596612665738000001?branchData={"branch_name":"Test branch Update","work_start_day":"1","work_end_day":"5","time_zone":"Asia/Calcutta","work_start_hour":"10:00 am","work_end_hour":"07:00 pm","is_any_day":false,"blk_flr_info":[{"building_id":"1596612665740000002","building_name":"WOODLANDS","floors":[{"floor_id":"1596612665741000003","floor_order":1,"floor_name":"Ground Floor"},{"floor_id":"1596612665742000004","floor_order":2,"floor_name":"Floor - 1"}]}],"rem_flr_info":[{"building_id":"1596612665740000002","rem_flr_ids":["1596612665743000005"]}]}Sample Response
Copied{
"work_end_hour":"07:00 pm",
"branch_id":"1596612665738000001",
"branch_name":"Test branch Update",
"work_start_day":1,
"buildings":[
{
"building_id":"1596612665740000002",
"building_name":"WOODLANDS",
"floors":[
{
"floor_name":"Ground Floor",
"floor_order":1,
"floor_id":"1596612665741000003"
},
{
"floor_name":"Floor - 1",
"floor_order":2,
"floor_id":"1596612665742000004"
}
],
"branch_id":"1596612665738000001",
"floor_count":0
}
],
"work_start_hour":"10:00 am",
"time_zone":"Asia/Calcutta",
"work_end_day":5
}Error message: If a Building is deleted during Branch update and if it has room(s) in it
Copied{
"error_message":"Building-1 is tagged with rooms and cannot be deleted",
"errorcode":"BUILDING_TAG_WITH_ROOMS",
"status":"failure"
}Error message: If a Floor is deleted during Branch update and if it has room(s) in it
Copied{
"error_message":"Floor-1 in Building-1 is tagged with rooms and cannot be deleted",
"errorcode":"FLOOR_TAG_WITH_ROOMS",
"status":"failure"
}