Publish Item

Description

Publishes a hosted service based on an existing source item.

Publishers can create feature services as well as tiled map services.

Feature services can be created using input files of type csv, excel, shapefile, serviceDefinition, geojson, sqliteGeodatabase, featureCollection, and fileGeodatabase.

Request Parameters

Parameter

Details

[Common Parameters]

For a complete listing, see Common parameters.

itemID

The ID of the item to be published.

Example: itemId=345313e619df46f387f9ededbe15ac56

file

The file to be uploaded. If uploading a file, the request must be a multipart request pursuant to IETF RFC1867.

text

NoteNote:

Only applicable to CSV, Microsoft Excel and feature collection types.

The text in the file to be published.

Example: text=<text_in_file>

fileType

Item type.

Values: serviceDefinition | shapefile | csv | excel | tilePackage | featureService | featureCollection | fileGeodatabase | geojson | scenepackage | vectortilepackage | imageCollection | mapService | sqliteGeodatabase

NoteNote:

imageCollection applies to Portal for ArcGIS only.

Example: filetype=shapefile

publishParameters

A JSON object describing the service to be created as part of the publish operation. The appropriate value for publish parameters depends on the file type being published.

Example: publishParameters={"name":"Streets"}

outputType

Only used when a feature service is published as a tile service.

Example: outputType=Tiles

overwrite

If true the feature service is overwritten.

NoteNote:

The default value is false. Applies to ArcGIS Online and Portal for ArcGIS 10.5 or above.

Values: true | false

Publisher parameters JSON object for CSV and Excel

The publishParameters JSON object used to publish a CSV is described below.

Parameter

Details

type

Indicates it's a CSV file.

Example:

"type": "csv"
name

(Required)

Name of the service to be created. The same name is reused as the name for the single layer within the service if the layerInfo parameter is not provided.

locationType

(Required)

Values: coordinates | address | lookup | none

When locationType = coordinates, the CSV or Excel data contains x,y information.

When locationType = address, the CSV or Excel data contains address fields that will be geocoded to a single point.

When locationType = lookup, the CSV or Excel data contains fields that can be mapped to well-known sets of geographies.

When locationType = none, the CSV or Excel data contains no spatial content and data will be loaded and subsequently queried as tabular data.

Based on this parameter, additional parameters will be required, for example, when specifying locationType = coordinates, the latitude and longitude field names must be specified.

latitudeFieldName

(Required if locationType = coordinates)

If locationType = coordinates, the name of the field that contains the y coordinate.

longitudeFieldName

(Required if locationType = coordinates)

If locationType = coordinates, the name of the field that contains the xcoordinate.

coordinateFieldType

(Optional) Used when locationType=coordinates

Specify the type of coordinates that contain location information.

Values: LatitudeAndLongitude (default) | MGRS | USNG

coordinateFieldName

(Optional) Used when locationType=coordinates

The name of the field that contains the coordinates specified in coordinateFieldType

addressTemplate

(Required if locationType = address)

A string value that defines the address to find based on CSV or Excel field values.

Example: "{Address} {City}, {State} {Zip}"

lookupType

(Required if locationType = lookup)

The type of place to look up.

lookupFields

(Required if locationType = lookup)

A JSON object with name value pairs that define the fields used to look up the location.

geocodeServiceUrl

The URL of the geocode service that supports batch geocoding.

sourceCountry

The two character country code associated with the geocoding service.

sourceLocale

The locale used for the geocoding service source.

addressFields

A JSON object indicates the location fields mapping to the corresponding field names in the input dataset that contains spatial information for batch geocoding.

Example:

{
			"Address": "Street",
			"City": "City",
			"Region": "State",
			"Postal": "Zip"
		}
standardizedFieldNames

A JSON object indicates the standardized field names mapping in the geocode service given the country selected.

{
			"Address": "Street",
			"City": "City",
			"Region": "State",
			"Postal": "ZIP",
			"PostalExt": "ZIP4",
			"CountryCode": "Country"
		}
layerInfo

(Required)

A JSON object that provides additional information about the dataset. The JSON format resembles the layerDescriptor used in publishing feature services to an on-premise spatial data server or ArcGIS Server. All parameters except fields are optional.

{ 
"id": <id>,
"name" : "<layer name>", 
"type" : "<type>",
"displayField": "<displayField>",
"description": "<description>",
"copyrightText": "<copyright text>",
"defaultVisibility": true,
"minScale" : <number>, 
"maxScale" : <number>, 
"extent" : {<extent JSON with spatial ref>}, 
"drawingInfo" : {<drawing info JSON>}, 
"allowGeometryUpdates": true,
"hasAttachments" : false, 
"htmlPopupType" : "<popup type>",
"globalIdField": "<name of the global Id field>",
"objectIdField" : "<name of object Id field>", 
"typeIdField" : "<type Id field>", 
"fields" : [<array of field JSON objects>], 
"indexes": [<array of indexes>],
"types" : [<array of type JSON objects>], 
"templates" : [<array of type JSON objects>], 
"supportedQueryFormats": "JSON, geoJSON",
"hasStaticData": false,
"maxRecordCount": <max num of records returned for a query>,
"standardMaxRecordCount": <max num of records returned when resultType is standard>,
"tileMaxRecordCount": <max num of records returned when resultType is tile>,
"maxRecordCountFactor": <multiplier applies to all 3 types of max record count>,
"capabilities" : "<service layer capabilities>"
}

Certain parameters such as geometryType and extent can be implied or calculated from the dataset.

Primary Key

The objectId field is used as the name of the primary key column. If this field is a non-editable integer, the primary key is also made an auto-incrementing column. If no objectId field is specified, an auto-incrementing column named FID is used.

description

A friendly description for the published dataset.

maxRecordCount

A double value indicating any constraints enforced on query operations.

The default is -1 or int.MaxValue indicating no constraint.

copyrightText

Copyright information associated with the dataset.

columnNames

[array of column names], overridden if layerInfo fields is specified.

If columnNames are omitted, the field names are inferred from the first line in source CSV.

columnDelimiter

A delimiter between data fields in each row of text.

Default is the comma character.

sourceSR

Spatial reference of the input coordinates. Default is WKID 4326.

Example:

{
			"wkid": 4326,
			"latestWkid": 4326
		}
targetSR

Target spatial reference of the coordinates as stored in the database. Default is WKID 102100.

Example:

{
			"wkid": 102100,
			"latestWkid": 3857
		}
editorTrackingInfo

A JSON object that specifies editor tracking information.

Example:

{
			"enableEditorTracking": false,
			"enableOwnershipAccessControl": false,
			"allowOthersToQuery": true,
			"allowOthersToUpdate": true,
			"allowOthersToDelete": false,
			"allowAnonymousToUpdate": true,
			"allowAnonymousToDelete": true
		}
dateFieldsTimeReference

A JSON object that specifies the data time zone information.

Example:

{
		"timeZone": "Pacific Standard Time"
	}

A sample publishParameters JSON object for a CSV is as follows:

{
	"type": "csv",
	"name": "Offices",
	"sourceUrl": "",
	"locationType": "address",
	"maxRecordCount": 2000,
	"geocodeServiceUrl": "http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer",
	"sourceCountry": "us",
	"sourceLocale": "en",
	"addressFields": {
		"Address": "Street",
		"City": "City",
		"Region": "State",
		"Postal": "Zip"
	},
	"standardizedFieldNames": {
		"Address": "Street",
		"City": "City",
		"Region": "State",
		"Postal": "ZIP",
		"PostalExt": "ZIP4",
		"CountryCode": "Country"
	},
	"columnDelimiter": ",",
	"qualifier": "\"",
	"targetSR": {
		"wkid": 102100,
		"latestWkid": 3857
	},
	"editorTrackingInfo": {
		"enableEditorTracking": false,
		"enableOwnershipAccessControl": false,
		"allowOthersToQuery": true,
		"allowOthersToUpdate": true,
		"allowOthersToDelete": false,
		"allowAnonymousToUpdate": true,
		"allowAnonymousToDelete": true
	},
	"layerInfo": {
		"currentVersion": 10.51,
		"id": 0,
		"name": "",
		"type": "Table",
		"displayField": "",
		"description": "",
		"copyrightText": "",
		"defaultVisibility": true,
		"relationships": [],
		"isDataVersioned": false,
		"supportsCalculate": true,
		"supportsTruncate": false,
		"supportsAttachmentsByUploadId": true,
		"supportsRollbackOnFailureParameter": true,
		"supportsStatistics": true,
		"supportsAdvancedQueries": true,
		"supportsValidateSql": true,
		"supportsCoordinatesQuantization": true,
		"supportsApplyEditsWithGlobalIds": false,
		"advancedQueryCapabilities": {
			"supportsPagination": true,
			"supportsPaginationOnAggregatedQueries": true,
			"supportsQueryRelatedPagination": true,
			"supportsQueryWithDistance": true,
			"supportsReturningQueryExtent": true,
			"supportsStatistics": true,
			"supportsOrderBy": true,
			"supportsDistinct": true,
			"supportsQueryWithResultType": true,
			"supportsSqlExpression": true,
			"supportsAdvancedQueryRelated": true,
			"supportsReturningGeometryCentroid": false,
			"supportsQueryWithDatumTransformation": true
		},
		"useStandardizedQueries": false,
		"geometryType": "esriGeometryPoint",
		"drawingInfo": {
			"renderer": {
				"type": "simple",
				"symbol": {
					"type": "esriPMS",
					"url": "RedSphere.png",
					"imageData": "iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPASUVORK5CYII=",
					"contentType": "image/png",
					"width": 15,
					"height": 15
				}
			}
		},
		"allowGeometryUpdates": true,
		"hasAttachments": false,
		"htmlPopupType": "",
		"hasM": false,
		"hasZ": false,
		"globalIdField": "",
		"typeIdField": "",
		"fields": [{
			"name": "Name",
			"type": "esriFieldTypeString",
			"alias": "Name",
			"sqlType": "sqlTypeNVarchar",
			"length": 256,
			"nullable": true,
			"editable": true,
			"domain": null,
			"defaultValue": null,
			"locationType": "unknown"
		}, {
			"name": "Street",
			"type": "esriFieldTypeString",
			"alias": "Street",
			"sqlType": "sqlTypeNVarchar",
			"length": 256,
			"nullable": true,
			"editable": true,
			"domain": null,
			"defaultValue": null,
			"locationType": "Address"
		}, {
			"name": "City",
			"type": "esriFieldTypeString",
			"alias": "City",
			"sqlType": "sqlTypeNVarchar",
			"length": 256,
			"nullable": true,
			"editable": true,
			"domain": null,
			"defaultValue": null,
			"locationType": "City"
		}, {
			"name": "State",
			"type": "esriFieldTypeString",
			"alias": "State",
			"sqlType": "sqlTypeNVarchar",
			"length": 256,
			"nullable": true,
			"editable": true,
			"domain": null,
			"defaultValue": null,
			"locationType": "Region"
		}, {
			"name": "Zip",
			"type": "esriFieldTypeString",
			"alias": "Zip",
			"sqlType": "sqlTypeNVarchar",
			"length": 256,
			"nullable": true,
			"editable": true,
			"domain": null,
			"defaultValue": null,
			"locationType": "Postal"
		}],
		"indexes": [],
		"types": [],
		"templates": [{
			"name": "New Feature",
			"description": "",
			"drawingTool": "esriFeatureEditToolPoint",
			"prototype": {
				"attributes": {
					"Name": null,
					"Street": null,
					"City": null,
					"State": null,
					"Zip": null
				}
			}
		}],
		"supportedQueryFormats": "JSON, geoJSON",
		"hasStaticData": false,
		"maxRecordCount": -1,
		"standardMaxRecordCount": 32000,
		"tileMaxRecordCount": 8000,
		"maxRecordCountFactor": 1,
		"capabilities": "Query"
	},
	"sourceCountryHint": "",
	"hasStaticData": true,
	"persistErrorRecordsForReview": true,
	"dateFieldsTimeReference": {
		"timeZone": "Pacific Standard Time"
	}
}

The publishParameters JSON object used to publish an Excel is described below.

Parameter

Details

type

Indicates it's an Excel file.

Example:

"type": "excel"
name

(Required)

Name of the service to be created.

description

A friendly description for the published dataset.

maxRecordCount

A double value indicating any constraints enforced on query operations.

The default is -1 or int.MaxValue indicating no constraint.

sourceSR

Spatial reference of the input coordinates. Default is WKID 4326.

Example:

{
			"wkid": 4326,
			"latestWkid": 4326
		}
targetSR

Target spatial reference of the coordinates as stored in the database. Default is WKID 102100.

Example:

{
			"wkid": 102100,
			"latestWkid": 3857
		}
editorTrackingInfo

A JSON object that specifies editor tracking information.

Example:

{
			"enableEditorTracking": false,
			"enableOwnershipAccessControl": false,
			"allowOthersToQuery": true,
			"allowOthersToUpdate": true,
			"allowOthersToDelete": false,
			"allowAnonymousToUpdate": true,
			"allowAnonymousToDelete": true
		}
hasAttachments

Indicates if the service has attachments.

layerInfo

A JSON object specifies service capabilities.

Example:

{
		"capabilities": "Query"
	}
layers

(Required)

An array of JSON objects that provides additional information about each sheet of the Excel file. A sample object as below:

{
		"currentVersion": 10.51,
		"id": 0,
		"name": "Offices",
		"type": "Table",
		"displayField": "",
		"description": "",
		"copyrightText": "",
		"locationType": "address",
		"geocodeServiceUrl": "http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer",
		"sourceLocale": "en",
		"sourceCountry": "us",
		"addressFields": {
			"Address": "Street",
			"City": "City",
			"Region": "State",
			"Postal": "Zip"
		},
		"standardizedFieldNames": {
			"Address": "Street",
			"City": "City",
			"Region": "State",
			"Postal": "ZIP",
			"PostalExt": "ZIP4",
			"CountryCode": "Country"
		},
		"excelSheetId": 0, //sheet ID is required
		"defaultVisibility": true,
		"relationships": [],
		"isDataVersioned": false,
		"supportsCalculate": true,
		"supportsTruncate": false,
		"supportsAttachmentsByUploadId": true,
		"supportsRollbackOnFailureParameter": true,
		"supportsStatistics": true,
		"supportsAdvancedQueries": true,
		"supportsValidateSql": true,
		"supportsCoordinatesQuantization": true,
		"supportsApplyEditsWithGlobalIds": false,
		"advancedQueryCapabilities": {
			"supportsPagination": true,
			"supportsPaginationOnAggregatedQueries": true,
			"supportsQueryRelatedPagination": true,
			"supportsQueryWithDistance": true,
			"supportsReturningQueryExtent": true,
			"supportsStatistics": true,
			"supportsOrderBy": true,
			"supportsDistinct": true,
			"supportsQueryWithResultType": true,
			"supportsSqlExpression": true,
			"supportsAdvancedQueryRelated": true,
			"supportsReturningGeometryCentroid": false,
			"supportsQueryWithDatumTransformation": true
		},
		"useStandardizedQueries": false,
		"allowGeometryUpdates": true,
		"hasAttachments": false,
		"htmlPopupType": "",
		"hasM": false,
		"hasZ": false,
		"globalIdField": "",
		"typeIdField": "",
		"fields": [{
			"name": "Name",
			"type": "esriFieldTypeString",
			"alias": "Name",
			"sqlType": "sqlTypeOther",
			"length": 256,
			"nullable": true,
			"editable": true,
			"domain": null,
			"defaultValue": null,
			"locationType": "unknown"
		}, {
			"name": "Street",
			"type": "esriFieldTypeString",
			"alias": "Street",
			"sqlType": "sqlTypeOther",
			"length": 256,
			"nullable": true,
			"editable": true,
			"domain": null,
			"defaultValue": null,
			"locationType": "Address"
		}, {
			"name": "City",
			"type": "esriFieldTypeString",
			"alias": "City",
			"sqlType": "sqlTypeOther",
			"length": 256,
			"nullable": true,
			"editable": true,
			"domain": null,
			"defaultValue": null,
			"locationType": "City"
		}, {
			"name": "State",
			"type": "esriFieldTypeString",
			"alias": "State",
			"sqlType": "sqlTypeOther",
			"length": 256,
			"nullable": true,
			"editable": true,
			"domain": null,
			"defaultValue": null,
			"locationType": "Region"
		}, {
			"name": "Zip",
			"type": "esriFieldTypeString",
			"alias": "Zip",
			"sqlType": "sqlTypeOther",
			"length": 256,
			"nullable": true,
			"editable": true,
			"domain": null,
			"defaultValue": null,
			"locationType": "Postal"
		}],
		"indexes": [],
		"types": [],
		"templates": [],
		"supportedQueryFormats": "JSON, geoJSON",
		"hasStaticData": false,
		"maxRecordCount": -1,
		"standardMaxRecordCount": 32000,
		"tileMaxRecordCount": 8000,
		"maxRecordCountFactor": 1,
		"capabilities": "",
		"dateFieldsTimeReference": {
			"timeZone": "Pacific Standard Time"
		}
	}

A sample publishParameters JSON object for an Excel file is as follows:

{
	"type": "excel",
	"name": "Offices",
	"sourceUrl": "",
	"maxRecordCount": 2000,
	"sourceSR": {
		"wkid": 4326,
		"latestWkid": 4326
	},
	"targetSR": {
		"wkid": 102100,
		"latestWkid": 3857
	},
	"editorTrackingInfo": {
		"enableEditorTracking": false,
		"enableOwnershipAccessControl": false,
		"allowOthersToQuery": true,
		"allowOthersToUpdate": true,
		"allowOthersToDelete": false,
		"allowAnonymousToUpdate": true,
		"allowAnonymousToDelete": true
	},
	"hasAttachments": false,
	"capabilities": "Create,Delete,Query,Update,Editing",
	"layers": [{
		"currentVersion": 10.51,
		"id": 0,
		"name": "Offices",
		"type": "Table",
		"displayField": "",
		"description": "",
		"copyrightText": "",
		"locationType": "address",
		"geocodeServiceUrl": "http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer",
		"sourceLocale": "en",
		"sourceCountry": "us",
		"addressFields": {
			"Address": "Street",
			"City": "City",
			"Region": "State",
			"Postal": "Zip"
		},
		"standardizedFieldNames": {
			"Address": "Street",
			"City": "City",
			"Region": "State",
			"Postal": "ZIP",
			"PostalExt": "ZIP4",
			"CountryCode": "Country"
		},
		"excelSheetId": 0,
		"defaultVisibility": true,
		"relationships": [],
		"isDataVersioned": false,
		"supportsCalculate": true,
		"supportsTruncate": false,
		"supportsAttachmentsByUploadId": true,
		"supportsRollbackOnFailureParameter": true,
		"supportsStatistics": true,
		"supportsAdvancedQueries": true,
		"supportsValidateSql": true,
		"supportsCoordinatesQuantization": true,
		"supportsApplyEditsWithGlobalIds": false,
		"advancedQueryCapabilities": {
			"supportsPagination": true,
			"supportsPaginationOnAggregatedQueries": true,
			"supportsQueryRelatedPagination": true,
			"supportsQueryWithDistance": true,
			"supportsReturningQueryExtent": true,
			"supportsStatistics": true,
			"supportsOrderBy": true,
			"supportsDistinct": true,
			"supportsQueryWithResultType": true,
			"supportsSqlExpression": true,
			"supportsAdvancedQueryRelated": true,
			"supportsReturningGeometryCentroid": false,
			"supportsQueryWithDatumTransformation": true
		},
		"useStandardizedQueries": false,
		"allowGeometryUpdates": true,
		"hasAttachments": false,
		"htmlPopupType": "",
		"hasM": false,
		"hasZ": false,
		"globalIdField": "",
		"typeIdField": "",
		"fields": [{
			"name": "Name",
			"type": "esriFieldTypeString",
			"alias": "Name",
			"sqlType": "sqlTypeOther",
			"length": 256,
			"nullable": true,
			"editable": true,
			"domain": null,
			"defaultValue": null,
			"locationType": "unknown"
		}, {
			"name": "Street",
			"type": "esriFieldTypeString",
			"alias": "Street",
			"sqlType": "sqlTypeOther",
			"length": 256,
			"nullable": true,
			"editable": true,
			"domain": null,
			"defaultValue": null,
			"locationType": "Address"
		}, {
			"name": "City",
			"type": "esriFieldTypeString",
			"alias": "City",
			"sqlType": "sqlTypeOther",
			"length": 256,
			"nullable": true,
			"editable": true,
			"domain": null,
			"defaultValue": null,
			"locationType": "City"
		}, {
			"name": "State",
			"type": "esriFieldTypeString",
			"alias": "State",
			"sqlType": "sqlTypeOther",
			"length": 256,
			"nullable": true,
			"editable": true,
			"domain": null,
			"defaultValue": null,
			"locationType": "Region"
		}, {
			"name": "Zip",
			"type": "esriFieldTypeString",
			"alias": "Zip",
			"sqlType": "sqlTypeOther",
			"length": 256,
			"nullable": true,
			"editable": true,
			"domain": null,
			"defaultValue": null,
			"locationType": "Postal"
		}],
		"indexes": [],
		"types": [],
		"templates": [],
		"supportedQueryFormats": "JSON, geoJSON",
		"hasStaticData": false,
		"maxRecordCount": -1,
		"standardMaxRecordCount": 32000,
		"tileMaxRecordCount": 8000,
		"maxRecordCountFactor": 1,
		"capabilities": "",
		"dateFieldsTimeReference": {
			"timeZone": "Pacific Standard Time"
		}
	}],
	"hasStaticData": true,
	"layerInfo": {
		"capabilities": "Query"
	}
}

Publish parameters JSON object for shapefiles, feature collections, and file geodatabases

The publishParameters JSON object used to publish shapefiles, feature collections, and file geodatabases is described below.

Parameter

Details

name

Name of the published service. The same name is reused as the name for the single layer within the service if the layerInfo parameter is not provided.

description

A friendly description for the published dataset. The same description is reused for the single layer within the service if the layerInfo parameter is not provided.

maxRecordCount

A double value indicating any constraints enforced on query operations.

The default is -1 or int.MaxValue indicating no constraint.

copyrightText

Copyright information associated with the dataset.

layerInfo

A JSON object that provides additional information about the dataset. The JSON format resembles the layerDescriptor used in publishing feature services to an on-premise spatial data server or ArcGIS Server.

{"name" : "<layer name>",  
"type" : "Feature Layer", 
"description" : "<description>", 
"copyrightText" : "<copyright text>", 
"geometryType" : "<geometry type>", 
"minScale" : <number>, 
"maxScale" : <number>, 
"extent" : {<extent JSON with spatial ref>}, 
"drawingInfo" : {<drawing info JSON>}, 
"hasAttachments" : false, 
"htmlPopupType" : "<popup type>", 
"objectIdField" : "<object Id field>", 
"globalIdField" : "", 
"typeIdField" : "<type Id field>", 
"fields" : [<array of field JSON objects>], 
"types" : [<array of type JSON objects>], 
"templates" : [<array of type JSON objects>], 
"capabilities" : "<Query and/or Editing, comma separated>"
}
targetSR

Target spatial reference of the geometries as stored in the database.

The default is WKID 102100.

A sample publishParameters JSON object for publishing shapefiles, feature collections, and file geodatabases is as follows:

{
  "name" : "Name of published result",
  "description" : "test description",
  "maxRecordCount" : 500,
  "copyrightText" : "test copyright",
  "targetSR" : { "wkid" : 4326 },
  "layerInfo" : 
    {
      "name" : "States From File", 
      "type" : "Feature Layer", 
      "geometryType" : "esri GeometryPolygon", 
      "minScale" : 0, 
      "maxScale" : 0,
      "drawingInfo" : {
        "renderer" : 
        {
          "type" : "simple", 
          "symbol" : 
          {
            "type": "esriSFS",
            "style": "esriSFSSolid",
            "color": [115,76,0,255],
            "outline": {
              "type": "esriSLS",
              "style": "esriSLSSolid",
              "color": [110,110,110,255],
              "width": 1
            }
          }
        },
        "transparency" : 0, 
        "labelingInfo" : null
      }, 
      "htmlPopupType" : "esriServerHTMLPopupTypeNone", 
      "fields" : [], 
      "capabilities" : "Query,Editing"
    }
}

Publishing from a service definition (.sd), tile package (.tpk) file or vector tile package (.vtpk) item

publishParameters are optional when publishing a service definition (.sd), vector tile package (.vtpk), or tile package (.tpk) file.

Response Properties

Property

Details

type

The resulting item is a feature service, map service, or vector tile service URL item.

serviceURL

The URL to the hosted feature, map service, or vector tile service.

size

The approximate size required for the service.

jobId

The job ID of the publishing process. All publishing operations are executed asynchronously. The caller is supposed to hold on to the job ID and check for job status of the job. The status can be checked using Status passing in jobType as a query parameter; for example jobType=publish.

serviceItemId

The ID of the new service item.

preserveEditUsersAndTimestamps

The preserveEditUsersAndTimestamps parameter allows the user to preserve editor tracking info of the users and timestamps while publishing online.

NoteNote:

The default is not to preserve editor tracking info.

Example: {"editorTrackingInfo":{"enableEditorTracking":true,"preserveEditUsersAndTimeStamps":true}}

Publishing a tile service from an existing feature service

Property

Details

type

The resulting item is a map service URL item.

serviceURL

The URL to the hosted feature or map service.

jobId

The job ID of the publishing process. All publishing operations are executed asynchronously. The caller is supposed to hold on to the job ID and check for job status of the job. The status can be checked using Status passing in jobType as a query parameter; for example, jobType=publish .

serviceItemId

The ID of the new service item.

Example Usage - Shapefile

URL for Publish Item

http://www.arcgis.com/sharing/rest/content/users/jsmith/publish
itemId=345313e619df46f387f9ededbe15ac56
filetype=shapefile
publishParameters={"name":"Streets Service"}

Example Usage - Vector Tile Package

URL for Publish Item

http://www.arcgis.com/sharing/rest/content/users/jsmith/publish
f=json
token=xxx
itemId=345313e619df46f387f9ededbe15ac56
filetype=vectortilepackage
publishParameters={"name":<"SampleBasemap">,"maxRecordCount":2000}
outputType=VectorTiles
buildInitialCache=true

JSON Response Syntax

{"services": [{"type":"<type of service>", 
"serviceurl":"<url to hosted service>",
"size":<size of service>,
"jobId":"<job id>",
"serviceItemId":"<new item id>"}]}

JSON Response Example

{"services":
[{"type":"Feature Service",
"serviceurl":"http://www.arcgis.com/fa019fbbfbb845d08cc9f0acde6dd8af/arcgis/rest/services/
Streets_Service/FeatureServer",
"size":2656729,
"jobId":"ff07c87a-dccd-46b4-9597-446dcda248ff",
"serviceItemId":"2e39b0b9550a40709f02a697cd9fc4fb"}]}

10/6/2017