- URL:
- https://[root]/content/users/[userName]/publish
- Methods:
GET
Example usage
The following is a sample ArcGIS Online request URL used to publish a shapefile:
https://www.arcgis.com/sharing/rest/content/users/jsmith/publish
Below is a sample ArcGIS Enterprise POST request used to demonstrate how to publish a shapefile:
POST /webadaptor/sharing/rest/content/users/jSmith/publish HTTP/1.1
Host: machine.domain.com
Content-Type: multipart/form-data; boundary=----boundary
Content-Length: []
------boundary
Content-Disposition: form-data; name="itemid"
345313e619df46f387f9ededbe15ac56
------boundary
Content-Disposition: form-data; name="file"; filename=""
Content-Type: application/octet-stream
------boundary
Content-Disposition: form-data; name="filetype"
shapefile
------boundary
Content-Disposition: form-data; name="publishParameters"
{"name":"Streets Service"}
------boundary
Content-Disposition: form-data; name="buildInitialCache"
false
------boundary
Content-Disposition: form-data; name="outputType"
------boundary
Content-Disposition: form-data; name="f"
json
------boundary--
Description
Publishes a hosted service based on an existing source item. Prior to publishing, items must be added using Add 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
, service
, geojson
, sqlite
, feature
, and file
.
- CSV and Microsoft Excel files (
.xls
,.xlsx
) that contain location fields (for example, address fields or x,y fields) are spatially enabled during the process of publishing. - Shapefiles and file geodatabases should be packaged as
.zip
files. - Tiled map services can be created from service definition (
.sd
) files, tile packages, and existing feature services. - Service definitions are authored in ArcGIS Pro and contain both the cartographic definition for a map and its packaged data together with the definition of the geoservice to be created.
- Vector tile packages (
.vtpk
) are created from a map (or a basemap) with the Create Vector Tile Package tool in ArcGIS Pro. - Use the Analyze operation to generate the default publishing parameters for CSV files and Microsoft Excel files.
Request parameters
Parameter | Details |
---|---|
| The ID of the item to be published. Example:
|
| The file to be uploaded. If uploading a file, the request must be a multipart request pursuant to IETF RFC1867. |
| The text in the file to be published. Syntax:
|
| Item type. Values: |
| 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. For more information, see individual publisher parameter sections below. Example:
|
| If the user do not provide an Example:
Values: |
| If Values: |
| New at ArcGIS Enteprise 10.8.1. The item ID of the item. The item ID must not exist and must be 32 alphanumeric values. Example:
|
| The response format. The default response format is Values: |
CSV publish parameters JSON properties
The publish
JSON object used to publish a CSV file is described below.
Parameter | Details |
---|---|
| Indicates a CSV file. Example:
|
(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 Example:
|
(Required) | Specifies the data contained in the CSV or Excel file. If set as Values: |
(Required if | Specifies the name of the field that contains the y-coordinate. |
(Required if | Specifies the name of the field that contains the x-coordinate. |
(Optional, used when | Specifies the type of coordinates that contain location information. The default value is Values: |
(Optional, used when | Indicates the name of the field that contains the coordinates specified in |
(Required if | A string value that defines the address to find based on CSV or Excel field values. Example:
|
(Required if | The type of place to look up. |
(Required if | A JSON object with name value pairs that define the fields used to look up the location. |
| The URL of the geocode service that supports batch geocoding. Example:
|
| The two-character country code associated with the geocoding service. Example:
|
| The locale used for the geocoding service source. Example:
|
| 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:
|
| A JSON object indicates the standardized field names mapping in the geocode service given the country selected. Example:
|
(Required) | A JSON object that provides additional information about the dataset. The JSON format resembles the Certain parameters such as The
|
| A description for the published dataset. |
| A double value indicating any constraints enforced on query operations. The default is -1 or Example:
|
| Copyright information associated with the dataset. |
| An array of column names, overridden if |
| A delimiter between data fields in each row of text. The default is the comma character ( Example:
|
| Spatial reference of the input coordinates. The default is WKID 4326. Example:
|
| Target spatial reference of the coordinates as stored in the database. The default is WKID 102100. Example:
|
| A JSON object that specifies editor tracking information. Example:
|
| Specifies the locator output fields. By default, only the location information ( Values: |
| A JSON object that specifies the data time zone information. Example:
|
CSV publish parameters example
A sample publish
JSON object for a CSV file is as follows:
{
"type": "csv",
"name": "Offices",
"sourceUrl": "",
"locationType": "address",
"maxRecordCount": 2000,
"geocodeServiceUrl": "https://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.8,
"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": "Querys"
},
"sourceCountryHint": "",
"hasStaticData": true,
"persistErrorRecordsForReview": true,
"candidateFieldsType": "Minimal",
"dateFieldsTimeReference": {
"timeZone": "Pacific Standard Time"
}
}
Excel publish parameters JSON properties
The publish
JSON object used to publish an Excel file is described below.
Parameter | Details |
---|---|
| Indicates an Excel file. Example:
|
(Required) | Name of the service to be created. Example:
|
| A description for the published dataset. |
| A double value indicating any constraints enforced on query operations. The default is -1 or Example:
|
| Spatial reference of the input coordinates. The default is WKID 4326. Example:
|
| Target spatial reference of the coordinates as stored in the database. The default is WKID 102100. Example:
|
| A JSON object that specifies editor tracking information. Example:
|
| Indicates if the service has attachments. Values: |
| A JSON object specifies service capabilities. Example:
|
(Required) | An array of JSON objects that provides additional information about each sheet of the Excel file. |
Excel publish parameters example
A sample publish
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.8,
"id": 0,
"name": "Offices",
"type": "Table",
"displayField": "",
"description": "",
"copyrightText": "",
"locationType": "address",
"geocodeServiceUrl": "https://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"
}
}
Shapefile, feature collections, and file geodatabases publish parameters JSON properties
The publish
JSON object used to publish shapefiles, feature collections, and file geodatabases is described below.
Parameter | Details |
---|---|
| Name of the published service. The same name is reused as the name for the single layer within the service if the Example:
|
| A user-friendly description for the published dataset. The same description is reused for the single layer within the service if the Example:
|
| A double value indicating any constraints enforced on query operations. The default is -1 or Example:
|
| Copyright information associated with the dataset. Example:
|
| A JSON object that provides additional information about the dataset. The JSON format resembles the Example:
|
| Target spatial reference of the geometries as stored in the database. The default is WKID 102100. Example:
|
Shapefile, feature collections, and file geodatabases publish parameters example
A sample publish
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"
}
}
Response properties
Property | Details |
---|---|
| The resulting item is a feature service, map service, or vector tile service URL item. |
| The URL to the hosted feature, map service, or vector tile service. |
| The approximate size required for the service. |
| 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. The status can be checked using Status passing in |
| The ID of the new service item. |
| The Example:
|
Response properties from publishing a tile service from an existing feature service
Property | Details |
---|---|
| The resulting item is a map service URL item. |
| The URL to the hosted feature or map service. |
| 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. The status can be checked using Status passing in |
| The ID of the new service item. |
Additional example usage
Vector tile package
Below is a sample ArcGIS Enterprise POST request used to demonstrate how to publish a vector tile package:
POST /webadaptor/sharing/rest/content/users/jSmith/publish HTTP/1.1
Host: machine.domain.com
Content-Type: multipart/form-data; boundary=----boundary
Content-Length: []
------boundary
Content-Disposition: form-data; name="itemid"
345313e619df46f387f9ededbe15ac56
------boundary
Content-Disposition: form-data; name="file"; filename=""
Content-Type: application/octet-stream
------boundary
Content-Disposition: form-data; name="filetype"
vectorTilePackage
------boundary
Content-Disposition: form-data; name="publishParameters"
{"name":"SampleBasemap","maxRecordCount":2000}
------boundary
Content-Disposition: form-data; name="buildInitialCache"
true
------boundary
Content-Disposition: form-data; name="outputType"
VectorTiles
------boundary
Content-Disposition: form-data; name="f"
json
------boundary--
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": "https://www.arcgis.com/fa019fbbfbb845d08cc9f0acde6dd8af/arcgis/rest/services/Streets_Service/FeatureServer",
"size": 2656729,
"jobId": "ff07c87a-dccd-46b4-9597-446dcda248ff",
"serviceItemId": "2e39b0b9550a40709f02a697cd9fc4fb"
}
]
}