/allDatasets/getLayers: Get Layers

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

Example usage

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

Use dark colors for code blocksCopy
1
2
3
4
5
6
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 Publish Layers 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.

Request parameters

ParameterDetails

datastoreId

(Required)

The itemId of a bulk-published data store.

Example

Use dark colors for code blocksCopy
1
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 object's type property can return either of the following values: table, featureClass, or relationshipClass.

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

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
{
  {
    "error": {
      "code": <code>,
      "messageCode": <a message code>,
      "message": <a reason>,
      "details": []
    }
  }
}

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