POST - Add branch
Purpose
This API helps in adding a branch to resource booking. You can add buildings and floors to each branch you add to resource booking. The buildings and floors can be given names and the floors can be listed using the floor order.
Request URL
https://calendar.zoho.com/api/v1/branches
OAuth Scope
scope=ZohoCalendar.branches.ALL
or
scope=ZohoCalendar.branches.CREATE
ALL - Full access to all branches
CREATE - Adds a branch to resource booking
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, mandatory
- 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, mandatory
- The block floor info is a JSONArray containing the values of the BuildingJson. The values of the BuildingJson are given below.
- BuildingJson:
- building_namestring, mandatory
- You can give names to the buildings that you add to resource booking.
- floor_countint, mandatory
- 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, mandatory
- The floors info is a JSONArray consisting of the values from the FloorJson. The values of the FloorJson are given below.
- FloorJson:
- 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, mandatory
- 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.
- time_zonestring, mandatory
- Mention the time zone in which the organization is located.
Sample Request
Copiedhttps://calendar.zoho.com/api/v1/branches?branchData={"branch_name":"Test branch","work_start_day":"1","work_end_day":"5","time_zone":"Asia/Calcutta","work_start_hour":"10:00 am","work_end_hour":"07:00 pm","blk_flr_info":[{"building_name":"WOODLANDS","floors":[{"floor_order":1,"floor_name":"Ground Floor"},{"floor_order":2,"floor_name":"Floor - 1"},{"floor_order":3,"floor_name":"Floor - 2"}]}]}Sample Response
Copied{
"work_end_hour":"07:00 pm",
"branch_id":"1596612665738000001",
"branch_name":"Test branch",
"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"
},
{
"floor_name":"Floor - 2",
"floor_order":3,
"floor_id":"1596612665743000005"
}
],
"branch_id":"1596612665738000001",
"floor_count":0
}
],
"work_start_hour":"10:00 am",
"time_zone":"Asia/Calcutta",
"work_end_day":5
}Error message: If a branch name is duplicated
Copied{
"error_message":"This branch name already exists. Enter a different branch name.",
"errorcode":"BRANCH_DUPLICATE_NOTALLOWED",
"status":"failure"
}Error message: If a building name is duplicated within a branch
Copied{
"error_message":"This building name Building-1 is duplicated. Enter a different building name.",
"errorcode":"BUILDING_DUPLICATE_NOTALLOWED",
"status":"failure"
}Error message: If a floor name is duplicated within a building
Copied{
"error_message":"This floor name Floor-1 is duplicated in Building-1 building. Enter a different floor name.",
"errorcode":"FLOOR_DUPLICATE_NOTALLOWED",
"status":"failure"
}