Export Item

Description

Exports a service item (POST only) to the specified output format. Available only to users with an organizational subscription. Invokable only by the service item owner or an administrator.

Request Parameters

Parameter

Details

[Common Parameters]

For a complete listing, see Common parameters.

itemId

The ID of the item to be exported.

Example: itemId=345313e619df46f387f9ededbe15ac56

exportFormat

The output format for the export.

Values: Shapefile | CSV | File Geodatabase | Feature Collection | GeoJson | Scene Package | KML | Excel

Example: exportFormat=Shapefile

exportParameters

A JSON object describing the layers to be exported and the export parameters for each layer.

Example: exportParameters= {"layers" : [ { "id" : 0 } ] }

Export Parameters JSON Object

The exportParameters JSON object is described below.

Property

Description

layers

(Required) An array of exportLayerInfo JSON objects that controls which layers are exported. Described in the table below.

targetSR

The target spatial reference for the exported features.

Export Layer Info JSON Object

The exportLayerInfo JSON object is described below.

Property

Description

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'.

A sample exportParameters JSON object is as follows:

{
   "layers" :[ {"id" : 0 },
               {"id" : 1, "where" : "POP1999 > 100000"}  
             ]
}
NoteNote:

If exportParameters is left empty, it is assumed that all layers should be exported.

Response Properties

The response object is described below.

Property

Details

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.

Example Usage

URL for Export Item

http://www.arcgis.com/sharing/rest/content/users/jsmith/export
itemId=345313e619df46f387f9ededbe15ac56
title:"MyExportedFeatures"
exportFormat="Shapefile"
exportParameters={"layers": [ {"id" : 0 } ] }

JSON Response Syntax

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

{
"type" : "Shapefile",
"size" : 656325,
"jobId" : "340f0f98-a5d2-48c0-b8ab-a1b418529024",
"exportItemId" : "4e37b0b8550a40709f02a695cd9fc4fc",
"serviceItemId":"2e39b0b9550a40709f02a697cd9fc4fb",
"exportFormat" : "Shapefile"
}

7/5/2017