Skip to content

/generateSuggestion: Generate Suggestion

URL:
https://<root>/content/users/[username]/items/[itemID]/generateSuggestion
Methods:
POST
Version Introduced:
12.0

Example usage

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

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
POST /<context>/sharing/rest/content/users/jdoe/items/10ba62fe50864339a8a3e0f18ca85506/generateSuggestion HTTP/1.1
Host: organization.example.com
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary2pofsTwn9UeU7bAg
Content-Length: []

------WebKitFormBoundary2pofsTwn9UeU7bAg
Content-Disposition: form-data; name="async"

false
------WebKitFormBoundary2pofsTwn9UeU7bAg
Content-Disposition: form-data; name="generateItemInformation"

true
------WebKitFormBoundary2pofsTwn9UeU7bAg
Content-Disposition: form-data; name="generateLayerInformation"

true
------WebKitFormBoundary2pofsTwn9UeU7bAg
Content-Disposition: form-data; name="generateFieldInformation"

true
------WebKitFormBoundary2pofsTwn9UeU7bAg
Content-Disposition: form-data; name="contextFilter"

[{"layerId":"0"}]
------WebKitFormBoundary2pofsTwn9UeU7bAg
Content-Disposition: form-data; name="layerDefinitions"


------WebKitFormBoundary2pofsTwn9UeU7bAg
Content-Disposition: form-data; name="language"

es
------WebKitFormBoundary2pofsTwn9UeU7bAg
Content-Disposition: form-data; name="f"

pjson
------WebKitFormBoundary2pofsTwn9UeU7bAg
Content-Disposition: form-data; name="token"

<token>
------WebKitFormBoundary2pofsTwn9UeU7bAg--

Description

The generateSuggestion operation uses generative AI and the context derived from the item's properties to generate suggested input for a feature layer's item, layer, and field information. This operation can provide suggestions for the following areas:

Item information

  • Title
  • Summary
  • Description
  • Tags

Layer information

  • Title
  • Description
  • Summary

Field information

  • Description
  • Field value type
  • Alias

While item, layer, and field suggestions can be generated using the API, it is recommended that organization members perform the full suggestion and application workflow through the item's page in the portal site.

Usage requirements

Generative AI capabilities are only enabled if an organization opts in. For this and other AI-related endpoints to be accessible to members, an organization administrator must first enable the use of AI assistants.

While the use of AI assistants can be enabled using the Update Settings operation, which requires an administrator be assigned the Security and infrastructure privilege (portal:admin:manageSecurity), it is recommended that this setting is enabled in the Settings tab of the Organization page in the portal site by administrators assigned the Organization website privilege (portal:admin:manageWebsite).

A member must be logged into the organization as one of the following to perform this operation:

  • A member that is assigned the default administrator role
  • The item owner
  • A member assigned a custom role with either the administrative privilege to update content, or the general privilege to create, update, and delete content
  • A member of a group that has the Shared Updates setting enabled and to which the item was shared

Request parameters

ParameterDetails

async

(Required)

Specifies whether the operation will run synchronously or asynchronously. If false, the operation is run synchronously. If true, the operation is run asynchronously and the JSON response will return a jobId that can be used to monitor the job's progress.

Values: true | false

generateItemInformation

(Optional)

Determines if item information suggestions are generated. If set to true, suggestions will be generated for the item's title, description, tags, and snippet (summary). The default value is true.

While this parameter is optional, the operation requires that at least one of the generative parameters be set as true.

Values: true | false

generateLayerInformation

(Optional)

Determines if layer information suggestions are generated. If set to true, suggestions will be generated for the layer's title, description, and snippet (summary). The default value is true.

While this parameter is optional, the operation requires that at least one of the generative parameters be set as true.

Values: true | false

generateFieldInformation

(Optional)

Determines if field information suggestions are generated. If set to true, suggestions will be generated for the field's description, field value type, and alias. The default value is true.

While this parameter is optional, the operation requires that at least one of the generative parameters be set as true.

Values: true | false

contextFilter

(Optional)

Specifies which layers are used when gathering information and data for the suggestions. By default, the information from each layer is used to generate suggestions unless this parameter limits the context the suggestions are derived from to specific layers.

Example

Use dark colors for code blocksCopy
1
[{"layerId":"0"}]

layerDefinitions

(Optional)

Defines the fields that will receive suggestions. If this parameter is not used to limit suggestions to specific fields, then all fields will receive suggestions.

Example

Use dark colors for code blocksCopy
1
[{"layerId": "0","fields": ["name","country","population"]}]

language

(Optional)

Specifies the language used in the response using the language code for Esri-supported languages. The response is returned in English unless otherwise specified.

f

The response format. The default format is html.

Values: html | json | pjson

JSON Response 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{
  "success": true,
  "suggestion": {
    "title": "Coyote Encounters Data",
    "description": "The Coyote Encounters Data feature service provides a detailed collection of geographic information regarding coyote encounters within a specified area. This service includes a feature layer that captures point geometries representing various types of encounters, such as sightings, feeding incidents, and garbage-related interactions. Each encounter is documented with essential attributes, including the date of the encounter and observer comments, facilitating a comprehensive understanding of coyote behavior and their interactions with human populations. The data reflects ongoing monitoring efforts, revealing patterns in coyote activity over time, which is crucial for wildlife management, urban planning, and public safety initiatives. This feature service is particularly valuable for communities looking to enhance awareness and develop strategies for coexistence with wildlife.",
    "tags": [
      "Coyote",
      "Wildlife Encounters",
      "Geographic Data"
    ],
    "snippet": "A feature service documenting coyote encounters, offering insights into their behavior and interactions with humans through geographic data.",
    "layers": [
      {
        "id": "0",
        "title": "Coyote Encounters Data",
        "description": "This feature layer provides a comprehensive collection of geographic data related to coyote encounters in a specified area. The data includes point geometries representing the locations of various encounters, which can be categorized as sightings, feeding, or garbage-related incidents. The layer captures essential attributes such as the date of the encounter and comments from observers, allowing for a detailed understanding of coyote behavior and interactions with humans. Notably, the statistics reveal a range of encounter dates, indicating ongoing monitoring of coyote activity over time. This information is valuable for wildlife management, urban planning, and public safety initiatives, as it helps identify patterns in coyote behavior and informs community awareness efforts.",
        "snippet": "A feature layer documenting coyote encounters, providing insights into their behavior and interactions with humans through geographic data.",
        "fields": [
          {
            "name": "objectid",
            "description": "A unique identifier for each record in the dataset.",
            "fieldValueType": "uniqueIdentifier",
            "alias": "OBJECTID"
          },
          {
            "name": "x",
            "description": "The X coordinate representing the geographic location of the encounter, measured in decimal degrees.",
            "fieldValueType": "coordinate",
            "alias": "X"
          },
          {
            "name": "y",
            "description": "The Y coordinate representing the geographic location of the encounter, measured in decimal degrees.",
            "fieldValueType": "coordinate",
            "alias": "Y"
          },
          {
            "name": "objectid_1",
            "description": "An additional unique identifier for each record, possibly used for internal purposes.",
            "fieldValueType": "uniqueIdentifier",
            "alias": "OBJECTID"
          },
          {
            "name": "location",
            "description": "The specific location where the coyote encounter occurred, which may include place names or descriptions.",
            "fieldValueType": "locationOrPlaceName",
            "alias": "LOCATION"
          },
          {
            "name": "encounter",
            "description": "The type of encounter with the coyote, which may include categories such as sighting, feeding, or garbage-related incidents.",
            "fieldValueType": "typeOrCategory",
            "alias": "ENCOUNTER"
          },
          {
            "name": "date_of_encounter",
            "description": "The date when the coyote encounter took place, stored in a date format.",
            "fieldValueType": "dateAndTime",
            "alias": "DATE_OF_ENCOUNTER"
          },
          {
            "name": "comments",
            "description": "Additional comments or observations related to the coyote encounter, providing context or details.",
            "fieldValueType": "description",
            "alias": "COMMENTS"
          }
        ]
      }
    ],
    "createdDate": 1753116056
  }
}

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