I am trying to create my first location by making a POST request to https://api.zoom.us/v2/rooms/locations.
When I make my HTTP request, the Zoom API seems to mandate that I provide a value in the parent_location_id field. This makes perfect sense when you are creating a floor inside a building, creating a building in a city, creating a city in a province, etc. However, it doesn’t make (to me anyway) when you are creating the top level location (say, a country for example). In this scenario, there is no “parent”. The location you are trying to create is the top-most location in the hierarchy.
I have tried specifying a null value, an empty string and I have also tried omitting the parent_location_id field in my HTTP request like so:
First attempt: {"name":"Country 1","parent_location_id":null}
Secont attempt: {"name":"Country 1","parent_location_id":""}
Third attempt: {"name":"Country 1"}
but the API rejects my three attempts and returns the following error message:
After a lot of trial and error, I finally figured it out. What was preventing me from adding a new location was actually the combination of two problems:
First, I discovered that you need to define your location structure by making the following API call:
PUT https://api.zoom.us/v2/rooms/locations/structure
{"structures":["building","floor"]}
“building” and “floor” are 2 of a possible 6 allowable values: country , state , city , campus , building and floor
Once you have defined your desired structure, you can add new locations.
Second thing I discovered, you must use your account Id as the parent id of a top-most location (such as a country for example). Like this example:
POST https://api.zoom.us/v2/rooms/locations
{"name":"ZoomNet Integration Testing: Building A","parent_location_id":"VjZoEArIT5y-<...snip...>"}