/createService: Create Service (Image Service)

URL:
https://[root]/content/users/[userName]/createService
Methods:
POST

Example usage

URL for Create Service operation

Use dark colors for code blocksCopy
1
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.

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 createParameters JSON object table below for further information.

outputType

The newly created service type.

Value: imageService

Example:

Use dark colors for code blocksCopy
1
outputType=imageService

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

Use dark colors for code blocksCopy
1
2
3
4
{
    "name": "SanDiego",
    "path": "\\datastore\elevation\SanDiegoSRTM.crf"
}

JSON Response syntax

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
{
   "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

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
{
   "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"
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.