Region Endpoint
Region Endpoint

Region Endpoint

Use the Region endpoint to manage regions.
The Region endpoint includes the following methods:
Method
Description
POST /api/v1/region
Add or update a region and, optionally, its children. The region is added as a top-level region if a parent region is not specified.
GET /api/v1/region
Returns a hierarchical list of all regions.
GET /api/v1/region/nodes
Returns a hierarchical list of all regions but includes additional information such as the number of registered users in each region.
GET /api/v1/region/{regionName}
Returns the specified region and any child regions.
DELETE /api/v1/region/{regionName}
Deletes the specified region. This also deletes any child regions and removes any associated managers or sites.
Region Example
This example creates a top-level Region named East, which has a child region named District3. District3 has two sites named Site4 and Site5.
The Swagger parameters for this example:
[ { "name": "East" "description": "Eastern Region", "children": [ {"name": "District3", "description": "Chicago", "children": [ {"name": "Site4"}, {"name": "Site5"} ] } ] } ]
The curl command for this example:
curl -X 'POST' \ 'https://<ZEMS_URL>/api/v1/region' \ -H 'accept: application/json' \ -H 'ApiKey: <ZEMS_API_KEY>' \ -H 'authorization: Bearer <TOKEN>' \ -H 'Content-Type: application/json' \ -d '[ { "name": "East", "description": "Eastern Region", \ "children": [ {"name": "District3", "description": "Chicago", \ "children": [ {"name": "Site4"}, {"name": "Site5"} ] } ] } ]'