Attachment Infos (Feature Service)

URL:
https://<root>/<serviceName>/FeatureServer/<layerId>/<featureId>/attachments
Methods:
GET
Child Resources:
Attachment
Required Capability:
Query
Version Introduced:
10.0

Description

The attachmentInfos resource returns information about attachments associated with a feature. This resource is available only if the layer has advertised that it has attachments. A layer has attachments if its hasAttachments property is true .

Each attachment info includes information about the attachment such as its ID, content type, size, and name.

The attachmentInfos resource has the following one child resource:

  • Attachment—Streams the content of an individual attachment.

Request parameters

ParameterDetails

gdbVersion

The geodatabase version to query. This parameter applies only if the isDataVersioned property of the layer is true . If this is not specified, the query will apply to the published map’s version.

Syntax: gdbVersion=<version>

Example: gdbVersion=SDE.DEFAULT

historicMoment

This option was added at 10.5 and works with ArcGIS Server services only. The historic moment to query. This parameter applies only if the supportsQueryWithHistoricMoment property of the layer being queried is set to true . This setting is provided in the layer resource. If historicMoment is not specified, the query will apply to the current feature and its attachments.

Syntax

Use dark colors for code blocksCopy
1
historicMoment=<Epoch time in milliseconds>

Example

Use dark colors for code blocksCopy
1
historicMoment=1199145600000

returnMetadata

If true , metadata stored in the exifInfo column will be returned for attachments that have exifInfo . This option is only supported when "name": "exifInfo" in the layer's attachmentProperties includes "isEnabled": true . When set to false , or not set, null is returned for exifInfo . The default is false .

Values: true | false

f

The response format. The default response format is html .

Values: html | json | pjson

Example usage

Use dark colors for code blocksCopy
1
https://services.myserver.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0/818654/attachments

JSON response syntax

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
  "attachmentInfos": [
    {
      "id": <attachmentId1>,
      "contentType": "<contentType1>",
      "size": <size1>,
      "name": "<name1>"
    },
    {
      "id": <attachmentId2>,
      "contentType": "<contentType2>",
      "size": <size2>,
      "name": "<name2>"
    }
  ]
}

JSON response example

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
  "attachmentInfos": [
    {
      "id": 3,
      "contentType": "video/quicktime",
      "size": 397540,
      "name": "360 degree view"
    },
    {
      "id": 2,
      "contentType": "application/pdf",
      "size": 270133,
      "name": "Sales Deed"
    },
    {
      "id": 1,
      "contentType": "image/jpg",
      "size": 45325,
      "name": "Picture of the house"
    }
  ]
}

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