Skip To Content

/assignCategorySchema: Assign Category Schema (Organization)

  • URL:https://[root]/portals/[portalID]/assignCategorySchema(POST only)

Example usage

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


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:


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.

Nota:

The forward slash (/) and comma (,) characters are reserved and cannot be used as values for the title property.

Example


{
  "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


{
  "success": true
}

JSON Response example

The following is a sample success response:


{
  "success": true
}

The following is a sample error message:


{
  "error": {
    "code": 400,
    "messageCode": "ORG_1132",
    "message": "Unable to assign category schema.",
    "details": ["Category schema exceeds max tree size or empty."]
  }
}