/assignCategorySchema: Assign Group Category Schema

URL:
https://[root]/community/groups/[groupID]/assignCategorySchema
Methods:
POST
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:

1
2
3
4
5
6
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:

1
2
3
4
5
6
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.

Request parameters

ParameterDetails

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.

Example, formatted for readability

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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

The response format. The default response format is html.

Values: html | json | pjson

Response properties

PropertyDetails

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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
  "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:

1
2
3
4
5
6
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:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
  "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:

1
2
3
4
5
6
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:

1
{"success": true}

The following error message is returned when more than five content category trees are included in the JSON object:

1
2
3
4
5
6
7
8
{
  "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:

1
2
3
4
5
6
7
8
{
  "error": {
    "code": 400,
    "messageCode": "ORG_1132",
    "message": "Unable to assign category schema.",
    "details": ["Invalid category schema."]
  }
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close