Attachment Infos (Map Service/Dynamic Layer)

URL:
https://<dynamic-feature-url>/attachments
Methods:
GET
Child Resources:
Attachment
Required Capability:
Query
Version Introduced:
10.1

Description

The attachment infos resource returns information about attachments associated with a feature. This resource is available only if the dynamic layer has advertised that it has attachments. A dynamic 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 attachment infos resource has 1 child resource:

  • Attachment: Streams the content of an individual attachment.

Request Parameters

ParameterDetails

f

Description: The response format. The default response format is html.

Values: html | json

layer

Description: Dynamic layer/table source definition.

Syntax:

1
2
3
4
{
    "id": <layerOrTableId>,
    "source": <layer source>
  }

Example:

1
2
3
4
5
6
7
8
9
{
  "id": 101,
  "source":
  {
    "type": "mapLayer",
    "mapLayerId": 0,
    "gdbVersion": "SDE.DynamicLayers"
  }
}

Example Usage

Attachment info for a feature (featureId 1) in a dynamic layer (existing map service layer with id 3):

https://myServer/arcgis/rest/services/Census/MapServer/dynamicLayer/1/attachments?layer={"id":101,"source":{"type":"mapLayer","mapLayerId":3}}&where=1=1&f=pjson

JSON Response Syntax

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

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.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close