CreateService (Image Service)

Description

The createService operation (POST only) allows you to create a hosted image service. You can use the API to create a hosted image service from raster data.

NoteNote:

This operation applies to ArcGIS Enterprise and is not available in ArcGIS Online.

Request parameters

Parameter

Details

[Common Parameters]

For a complete listing, see Common parameters.

createParameters

A JSON object specifying the properties of the newly-created service. See the Create Parameters JSON object table below for further information.

outputType

The newly-created service type.

Value: imageService

Example: outputType=imageService

Create parameters JSON object

The createParameters JSON object is described in the table below. All properties are optional unless marked as Required.

Property

Description

name

(Required) Name of the service to be created. This name must be unique. If the name already exists, the operation will fail.

serviceDescription

Description given to the service.

capabilities

Specifies the image service capabilities: Image, Catalog, and Mensuration.

description

A user-friendly description for the published dataset.

copyrightText

Copyright information associated with the dataset.

Response properties

Property

Details

encodedServiceURL

The encoded URL to the hosted service.

itemId

The unique ID for this item.

name

Name of the service item.

serviceItemId

The ID of the new service item.

serviceurl

The URL to the hosted service.

size

The size of the item.

success

Indicates if the operation was successful.

type

The type of service created.

description

The description of the new service item.

tags

The tags used to describe the service item.

snippet

Snippet or summary for the new service item.

Example usage

URL for Create Service operation

http://www.arcgis.com/sharing/rest/content/users/jsmith/createService

Example of JSON used to create an image service

The following shows an example of the createParameters JSON used to create an image service from a raster dataset. To create an empty service, remove the path parameter.

{
    "name": "SanDiego",
    "path": "\\datastore\elevation\SanDiegoSRTM.crf"
}

JSON response syntax

{
   "encodedServiceURL": <URL>,
   "itemId": "<item id>",
   "name": "<name of new service>",
   "serviceItemId": "<service id>",
   "serviceurl": "<url of service>",
   "size": "<size of new service>",
   "success": true | false,
   "type": "Image Service",
   "description": "<description of the new service>",
   "tags": "<tags used for service>",
   "snippet": "<snippet given for service>"
}

JSON response example

{
                "encodedServiceURL": "http://myportal.esri.com/arcgis/rest/services/Hosted/SanDiego/ImageServer",
                "itemId": "43769096bf8d468e9a82394cf2c6f189",
                "name": "SanDiego",
                "serviceItemId": "43769096bf8d468e9a82394cf2c6f189",
                "serviceurl": "http://myportal.esri.com/arcgis/rest/services/Hosted/SanDiego/ImageServer",
                "size": -1,
                "success": true,
                "type": "Image Service"
}

7/27/2017