/assignCategorySchema: Assign Category Schema (Organization)

URL:
https://[root]/portals/[portalID]/assignCategorySchema
Methods:
POST

Example usage

The following is a sample ArcGIS Online POST request for the assignCategorySchema operation:

Use dark colors for code blocksCopy
1
2
3
4
5
6
POST /sharing/rest/portals/0123456789ABCDEF/assignCategorySchema HTTP/1.1
Host: org.arcgis.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

{"categorySchema":[{"title":"Categories","categories":[{"title":"Basemaps"}]}]}

The following is a sample ArcGIS Enterprise POST request for the assignCategorySchema operation:

Use dark colors for code blocksCopy
1
2
3
4
5
6
POST /webadaptor/sharing/rest/portals/0123456789ABCDEF/assignCategorySchema HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

{"categorySchema":[{"title":"Categories","categories":[{"title":"Basemaps"}]}]}

Description

The assignCategorySchema operation allows organization administrators to set up content categories for the organization as a hierarchical set of classes to help organize and browse items.

An organization can have a maximum of five category trees and each category schema can have up to four hierarchical levels. An organization can have a maximum of 200 categories. The title of each category can have up to 100 characters and the description of each category can have up to 300 characters.

The operation is available to both Esri default administrators and custom roles with the portal:admin:updateItemCategorySchema privilege.

Request parameters

ParameterDetails

categorySchema

A categorySchema object that consists of an array of JSON objects representing top level categories. Each object can include 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

Use dark colors for code blocksCopy
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
51
52
53
{
  "categorySchema": [
    {
      "title": "Categories",
      "description": "All types of basemaps.",
      "categories": [
        {
          "title": "Basemaps",
          "categories": [
            {
              "title": "Partner Basemap"
            },
            {
              "title": "Esri Basemaps",
              "categories": [
                {
                  "title": "Esri Raster Basemap"
                },
                {
                  "title": "Esri Vector Basemap"
                }
              ]
            }
          ]
        },
        {
          "title": "Imagery",
          "description": "All types of imagery.",
          "categories": [
            {
              "title": "Multispectral Imagery"
            },
            {
              "title": "Temporal Imagery"
            }
          ]
        }
      ]
    },
    {
      "title": "Region",
      "description": "Regional maps and data.",
      "categories": [
        {
          "title": "US"
        },
        {
          "title": "World"
        }
      ]
    }
  ]
}

f

The response format. The default format is html.

Values: html | json | pjson

Response properties

PropertyDetails

success

Indicates whether the operation was successful.

JSON Response syntax

Use dark colors for code blocksCopy
1
2
3
{
  "success": true
}

JSON Response example

The following is a sample success response:

Use dark colors for code blocksCopy
1
2
3
{
  "success": true
}

The following is a sample error message:

Use dark colors for code blocksCopy
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."]
  }
}

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