Skip To Content

/createService: Create Service (Image Service)

  • URL:https://[root]/content/users/[userName]/createService(POST only)

Example usage

URL for Create Service operation

https://myserver.mydomain.com/sharing/rest/content/users/jsmith/createService

Description

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

Note:

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

Request parameters

ParameterDetails
[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.

PropertyDescription
name

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

The ArcGIS Enterprise portal does not allow spaces or special characters other than underscores in a service name.

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

PropertyDetails
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 whether 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 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": "https://myportal.mydomain.com/arcgis/rest/services/Hosted/SanDiego/ImageServer",
                "itemId": "43769096bf8d468e9a82394cf2c6f189",
                "name": "SanDiego",
                "serviceItemId": "43769096bf8d468e9a82394cf2c6f189",
                "serviceurl": "https://myportal.mydomain.com/arcgis/rest/services/Hosted/SanDiego/ImageServer",
                "size": -1,
                "success": true,
                "type": "Image Service"
}