Skip To Content
ArcGIS Developers
Dashboard

/assignCategorySchema: Assign Group Category Schema

  • URL:https://[root]/community/groups/[groupID]/assignCategorySchema(POST only)
  • Version Introduced:ArcGIS Enterprise: 10.6.1 | ArcGIS Online: April 2018

Example Usage

An example ArcGIS Online URL to access assignCategorySchema.

https://www.arcgis.com/sharing/rest/community/groups/826ab72ed44c48beb8735c2634e0bfad/assignCategorySchema

An example ArcGIS Enterprise URL to access assignCategorySchema:

https://machine.domain.com/webadaptor/sharing/rest/community/groups/826ab72ed44c48beb8735c2634e0bfad/assignCategorySchema

The following is a sample POST request for ArcGIS Enterprise:

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

This 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. 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, and ISO that can be used. To learn more about creating group content categories through the portal, see Own Groups.

Request parameters

ParameterDetails
categorySchema

A categorySchema object that consists of an array of JSON objects representing top level categories. Each object has 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 or subcategories and so on.

f

The response format. The default response format is html.

Values: html | json | pjson

Response properties

PropertyDetails
success

Indicates whether the operation was successful

Example one: 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 two: 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."]
  }
}