/export: Export Item

URL:
https://[root]/content/users/[userName]/export
Methods:
POST

Example Usage

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

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

itemId=345313e619df46f387f9ededbe15ac56&title=MyExportedFeatures&exportFormat=shapefile&exportParameters={"layers":[{"id":0}]}&f=pjson

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

Use dark colors for code blocksCopy
1
2
3
4
5
6
POST /<context>/sharing/rest/content/users/jsmith/export HTTP/1.1
Host: organization.example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

itemId=345313e619df46f387f9ededbe15ac56&title=MyExportedFeatures&exportFormat=shapefile&exportParameters={"layers":[{"id":0}]}&f=pjson

Description

The export operation exports a hosted service item to a specified output format.

Request Parameters

ParameterDetails

itemId

The ID of the item to be exported.

Example:

Use dark colors for code blocksCopy
1
itemId=345313e619df46f387f9ededbe15ac56

exportFormat

The output format for the export.

Values: shapefile | csv | file geodatabase | feature collection | geojson | geoPackage | Scene Package | kml | excel | Vector Tile Package

exportParameters

A JSON object describing the layers to be exported and the export parameters for each layer. If exportParameters is left empty, it is assumed that all layers should be exported.

Example:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
{
  "layers": [
    {
      "id": 0
    },
    {
      "id" : 1,
      "where" : "POP1999 > 100000"
    }
  ]
}

f

The response format. The default format is html.

Values: html | json | pjson

Export Parameters JSON Object

PropertyDescription

layers

(Required)

An array of exportLayerInfo JSON objects that controls which layers are exported. See the Export Layer Info table below.

targetSR

The target spatial reference for the exported features.

Export Layer Info JSON Object

PropertyDescription

id

(Required)

The ID of the layer within the service to be exported.

where

A where clause used to filter features for the layer.

includeGeometry

Controls if feature geometries are included in the export results. The default is 'true'.

xColumnName

Only applies to CSV exportFormat. The name of the field in the CSV file that will contain the x coordinate of exported point geometries. The default value is 'x'.

yColumnName

Only applies to CSV exportFormat. The name of the field in the CSV file that will contain the y coordinate of exported point geometries. The default value is 'y'.

Response Properties

PropertyDetails

type

The type of the resulting item.

size

The size of the resulting item.

jobId

The job ID of the export job.

exportItemId

The ID of the result item of the export.

serviceItemId

The ID of the service item that was exported.

exportFormat

The format of the export.

JSON Response Syntax

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
{
    "type":<type of the exported  item>,
    "size":<size of the exported item>,
    "jobId":<jobId for the export job>
    "exportItemId":<id of the exported item that is created>,
    "serviceItemId": <id  of the hosted feature service item that was exported>,
    "exportFormat": <exportFormat>
}

JSON Response Example

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
{
    "type" : "Shapefile",
    "size" : 656325,
    "jobId" : "340f0f98-a5d2-48c0-b8ab-a1b418529024",
    "exportItemId" : "4e37b0b8550a40709f02a695cd9fc4fc",
    "serviceItemId":"2e39b0b9550a40709f02a697cd9fc4fb",
    "exportFormat" : "Shapefile"
}

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