Generate Attachment URL's?

1664
1
11-03-2015 05:02 AM
PaulBoehnlein
New Contributor II

Hello, I have a feature service hosted on an internal server with a table of attachments.  I am using these attachments in an AGOL web application with pop-ups.  The pop-up link opens a new browser window with a URL similar to "servername/arcgis/rest/services/Feature_Dataset_Name/Feature_Class_Name/FeatureServer/0/75362/attachments/62855".  I was wondering if there is a way to generate a batch table that will contain the URL's for all of my attachments?  I would like to use these URL's in applications outside of AGOL.

Thanks in advance!

1 Reply
ChrisSmith7
Frequent Contributor

If I understand correctly, couldn't you just execute a query? Something like

https://servername/arcgis/rest/services/serverdirectory/mapservice/MapServer/0/query?where=objectid+...

&text=

&objectIds=

&time=

&geometry=

&geometryType=esriGeometryEnvelope

&inSR=&spatialRel=esriSpatialRelIntersects

&relationParam=

&outFields=ObjectID,URL

&returnGeometry=false

&maxAllowableOffset=

&geometryPrecision=

&outSR=

&returnIdsOnly=false

&returnCountOnly=false

&orderByFields=

&groupByFieldsForStatistics=

&outStatistics=

&returnZ=false

&returnM=false

&gdbVersion=

&returnDistinctValues=false

&returnTrueCurves=false

&resultOffset=

&resultRecordCount=

&f=pjson

This would get you a JSON object you can consume outside of AGOL.

0 Kudos