- URL:https://[root]/community/groups/[groupID]/assignCategorySchema(POST only)
- Version Introduced:ArcGIS Enterprise: 10.6.1 | ArcGIS Online: April 2018
Example usage
The following is a sample ArcGIS Online POST request for the assignCategorySchema operation:
POST /sharing/rest/community/groups/826ab72ed44c48beb8735c2634e0bfad/assignCategorySchema HTTP/1.1
Host: org.arcgis.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []
categorySchema={"categorySchema": [{"title": "Categories","categories": [{"title": "Basemaps","categories": [{"title": "Partner Basemap"},{"title": "Esri Basemaps","categories": [{"title": "Esri Raster Basemap"},{"title": "Esri Vector Basemap"}]}]},{"title": "Imagery","categories": [{"title": "Multispectral Imagery"},{"title": "Temporal Imagery"}]},{"title": "Region","categories": [{"title": "US"},{"title": "World"}]}]}]}&f=pjson
The following is a sample ArcGIS Enterprise POST request for the assignCategorySchema operation:
POST /webadaptor/sharing/rest/community/groups/826ab72ed44c48beb8735c2634e0bfad/assignCategorySchema HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []
categorySchema={"categorySchema": [{"title": "Categories","categories": [{"title": "Basemaps","categories": [{"title": "Partner Basemap"},{"title": "Esri Basemaps","categories": [{"title": "Esri Raster Basemap"},{"title": "Esri Vector Basemap"}]}]},{"title": "Imagery","categories": [{"title": "Multispectral Imagery"},{"title": "Temporal Imagery"}]},{"title": "Region","categories": [{"title": "US"},{"title": "World"}]}]}]}&f=pjson
Description
The assignCategorySchema operation allows group owners or managers to set up content categories for a group. Content categories are hierarchical sets of classes to help organize and browse group content. Each group can have a maximum of five category trees, and each category schema can have up to four hierarchical levels, including the category tree. The maximum number of categories and subcategories a group can have is 200. Each category must have a title with fewer than 100 characters and a description with fewer than 300 characters.
Note:
Though this operation allows you to create up to five content category trees, only one category tree will be displayed when viewing a group's Content page, when viewing the My Groups tab on the Content page, and when using the content categories as a search filter in Map Viewer Classic. It is recommended that you create a comprehensive and complete category hierarchy and naming scheme that can fit in one content category tree if you are using this operation to configure a tree for use on these pages. In addition to the Sharing API, the portal can be used to create group content categories and provides a list of preset content categories from ArcGIS Living Atlas, INSPIRE Classic, and ISO that can be used. To learn more about creating group content categories through the portal, see Own groups.
Request parameters
Parameter | Details |
---|---|
categorySchema | A categorySchema object that consists of an array of JSON objects representing top level categories. Each object can have the title, description, and categories properties in which categories consists of an array of objects with each having the same properties and represents the descendant categories, subcategories, and so on. Note:The forward slash (/) and comma (,) characters are reserved and cannot be used as values for the title property. Example, formatted for readability
|
f | The response format. The default response format is html. Values: html | json | pjson |
Response properties
Property | Details |
---|---|
success | Indicates whether the operation was successful |
Additional example usage
Example 1: Single category tree
The following JSON object outlines a single category tree, Categories, and its three second-level child categories:Basemaps, Imagery, and Region. Each second-level category has multiple subcategories that are used to fine-tune broader category ideas.
{
"categorySchema": [
{
"title": "Categories",
"categories": [
{
"title": "Basemaps",
"categories": [
{
"title": "Partner Basemap"
},
{
"title": "Esri Basemaps",
"categories": [
{
"title": "Esri Raster Basemap"
},
{
"title": "Esri Vector Basemap"
}
]
}
]
},
{
"title": "Imagery",
"categories": [
{
"title": "Multispectral Imagery"
},
{
"title": "Temporal Imagery"
}
]
},
{
"title": "Region",
"categories": [
{
"title": "US"
},
{
"title": "World"
}
]
}
]
}
]
}
The following is a sample POST request for ArcGIS Enterprise using the JSON example above:
POST /webadaptor/sharing/rest/community/groups/826ab72ed44c48beb8735c2634e0bfad/assignCategorySchema HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []
categorySchema={"categorySchema": [{"title": "Categories","categories": [{"title": "Basemaps","categories": [{"title": "Partner Basemap"},{"title": "Esri Basemaps","categories": [{"title": "Esri Raster Basemap"},{"title": "Esri Vector Basemap"}]}]},{"title": "Imagery","categories": [{"title": "Multispectral Imagery"},{"title": "Temporal Imagery"}]},{"title": "Region","categories": [{"title": "US"},{"title": "World"}]}]}]}&f=pjson
Example 2: Multiple category trees
The following JSON object outlines three separate content category trees—Categories, Region, and Services—and their various subcategories:
{
"categorySchema": [
{
"title": "Categories",
"categories": [
{
"title": "Basemaps",
"categories": [
{
"title": "Partner Basemap"
},
{
"title": "Esri Basemaps",
"categories": [
{
"title": "Esri Raster Basemap"
},
{
"title": "Esri Vector Basemap"
}
]
}
]
}
]
},
{
"title": "Region",
"categories": [
{
"title": "US"
},
{
"title": "World"
}
]
},
{
"title": "Services",
"categories": [
{
"title": "Feature Services"
},
{
"title": "Map Services"
}
]
}
]
}
The following is a sample POST request for ArcGIS Enterprise using the JSON example above:
POST /webadaptor/sharing/rest/community/groups/826ab72ed44c48beb8735c2634e0bfad/assignCategorySchema HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []
categorySchema={"categorySchema": [{"title": "Categories","categories": [{"title": "Basemaps","categories": [{"title": "Partner Basemap"},{"title": "Esri Basemaps","categories": [{"title": "Esri Raster Basemap"},{"title": "Esri Vector Basemap"}]}]}]},{"title": "Region","categories": [{"title": "US"},{"title": "World"}]},{"title": "Services","categories": [{"title": "Feature Services"},{"title": "Map Services"}]}]}&f=pjson
JSON Response example
The following response is returned when assignCategorySchema is performed successfully:
{"success": true}
The following error message is returned when more than five content category trees are included in the JSON object:
{
"error": {
"code": 400,
"messageCode": "ORG_1132",
"message": "Unable to assign category schema.",
"details": ["Category schema exceeds max tree size or empty."]
}
}
The following error message is returned when the JSON object has incorrect syntax:
{
"error": {
"code": 400,
"messageCode": "ORG_1132",
"message": "Unable to assign category schema.",
"details": ["Invalid category schema."]
}
}