Hello I’ve seen this question asked but never seen a solution... but: is there a way to query the attachment service URL?
Example: https://services1.arcgis.com/AGOInstanceName/ArcGIS/rest/services/FeatureName/FeatureServer/3/queryA...
I’d like to query the whole attachment table related to a feature service so an application I’m creating can use the URL’s to pull up the attachments.
I can query and capture the data for the service but I can't capture the attachments that are related without iterating through all the object ids.
There is a returnUrl parameter which returns the attachment URL with the results: https://developers.arcgis.com/rest/services-reference/query-attachments-feature-service-layer-.htm#G...
You still have to append a token if it's a secured service though, otherwise the link won't open.
Thanks Michael. But I’ve tried the returnurl parameter. In fact, here is what I tried exactly:
as you can see, I’ve included the returnurl parameter... unfortunately I only get the other data but not the url.
Any ideas..?
Here is the relavant portion of the query:
You have to use the queryAttachments endpoint (links in comments above use the query endpoint) which is layer specific (i.e. you must specify FeatureLayer/<layer_number>/queryAttachments). So something like this works (HTML version): https://services5.arcgis.com/v3DMn7xrRivFMRiU/ArcGIS/rest/services/survey123_86170d7dd0954ceb838466f...
Or this for pjson: https://services5.arcgis.com/v3DMn7xrRivFMRiU/ArcGIS/rest/services/survey123_86170d7dd0954ceb838466f...