Skip To Content
ArcGIS Developer
Dashboard

/allDatasets/getLayers: Get Layers

  • URL:https://[root]/portals/[portalID]/datastores/allDatasets/getLayers
  • Version Introduced:10.7.1

Example usage

Below is a sample ArcGIS Enterprise POST request for the getLayers operation:


POST /webadaptor/sharing/rest/portals/0123456789ABCDEF/datastores/getLayers HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

datastoreId=55d87f404a7e420bb969ccb70254bfec&f=pjson

Description

The getLayers operation returns a list of layers bulk published from a data store with the publishLayers operation. The getLayers operation returns an array of tuples, with each tuple containing two objects: a layer and the dataset it was published from. For example, the feature layer CITIES was published from the feature class CITIES.

Note:

Only the owner of the data store item or an administrator can invoke this operation. Other users should take advantage of the item relationship between the data store item and the layers published from the data store.

Request parameters

ParameterDetails
datastoreId

(Required)

The itemId of a bulk-published data store.

Example

datastoreId=55d87f404a7e420bb969ccb70254bfec
f

The response format. The default format is html.

Value: html | json | pjson

JSON Response examples

If successful, getLayers will return the layer information for the data store. The dataset type can return either of the following values: table, featureClass, or relationshipClass.


{
  "layerAndDatasets": [
    {
      "layer": {
        "id": "1a1dbdf5b5a044fcbbe7ee5af5e9f807",
        "title": "CITIES",
        "created": 1543962040410,
        "modified": 1543962043256,
        "url": "https://webadaptor.domain.com/server/rest/services/TestFolder/Name/FeatureServer",
        "type": "Feature Service"
      },
      "dataset": {
        "name": "SDE.CITIES",
        "displayName": "CITIES",
        "type": "featureClass",
        "datastoreId": "42d41b6663c14e8699dc630ccaf87ca6",
        "path": "/SDE.CITIES"
      }
    },
    {
      "layer": {
        "id": "26b8a8ad6618408da1761edfc6ab2fad",
        "title": "StreetsFew",
        "created": 1543962072225,
        "modified": 1543962081239,
        "url": "https://webadaptor.domain.com/server/rest/services/TestFolder/Name/MapServer",
        "type": "Map Service"
      },
      "dataset": {
        "name": "SDE.StreetsFew",
        "displayName": "StreetsFew",
        "type": "featureClass",
        "datastoreId": "42d41b6663c14e8699dc630ccaf87ca6",
        "path": "/SDE.RedlandsFewFeats/SDE.StreetsFew"
      }
    }
  ]
}

If the operation fails, getLayers will return an error similar to the message below:


{
  {
    "error": {
      "code": <code>,
      "messageCode": <a message code>,
      "message": <a reason>,
      "details": []
    }
  }
}