How to download feature service from AGOL with attachments?

4154
11
11-22-2015 06:23 PM
FelixPertziger
New Contributor III

In the past I was able to use REST/Create Replica service for that.

It still downloading features and attachments, however with broken link between two, i.e. field REL_OBJECTID in related table is populated by {00000000-0000-0000-0000-000000000000}.

Is this something to do with expiry of my account? Or something has changed and I have to download/consume credit points through analysys option?

Regards

Felix

0 Kudos
11 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Felix,

The following tool will allow you to download a feature service with attachments:

Download ArcGIS Online Feature Service or ArcGIS Server Feature/Map Service

0 Kudos
FelixPertziger
New Contributor III

Hi Jake

thank you very much but it gives me

URL is incorrect.  Or, Service is secure, please enter username and password.

Help please. Is this about EXPIRY of my account?

0 Kudos
JakeSkinner
Esri Esteemed Contributor

If your ArcGIS Online account is expired I don't believe you will be able to access the service.  If you copy/paste the URL into a web browser, are you able to access the REST directory of the service?

0 Kudos
FelixPertziger
New Contributor III

Yes, I am. Moreover I can view features and attachments in desktop.

0 Kudos
JakeSkinner
Esri Esteemed Contributor

If the service is shared with 'Everyone', can you provide the URL?

0 Kudos
FelixPertziger
New Contributor III

It is shared with my team only. I am prepared to give you my user name and password. How can I do it safely?

0 Kudos
FelixPertziger
New Contributor III

Jake

I have my credits back, it 2500 total. Still nothing happening. I am unable to use your tool, extract data task is not working either.

Are you able to help?

Rgards,

Felix

0 Kudos
JakeSkinner
Esri Esteemed Contributor

I'm not sure what is wrong with the service.  The tool does work, you can try it on the following feature service if you like:

http://services.arcgis.com/dlFJXQQtlWFB4qUk/arcgis/rest/services/ResidentialBuildings/FeatureServer/...

One thing you can try is make a local copy of the feature service in ArcMap.  You can do this by first signing into ArcGIS Online with Desktop > and then add the service from 'My Hosted Services' in the catalog window.

FelixPertziger
New Contributor III

Well, not on my machine

Executing: DownloadService true false "http://services.arcgis.com/dlFJXQQtlWFB4qUk/arcgis/rest/services/ResidentialBuildings/FeatureServer/... " false false # # D:\Scratch\EBOP.gdb\buildings true #

Start Time: Thu Nov 26 08:15:09 2015

Running script DownloadService...

Generating Token

Failed script DownloadService...

Traceback (most recent call last):

  File "C:\URS-Data\URS-Data\ESRI\Tools\My Toolboxes\Download\Download Service with Attachments.py", line 48, in <module>

    response = urllib2.urlopen(req)

  File "C:\Program Files (x86)\Python27\ArcGIS10.2\Lib\urllib2.py", line 127, in urlopen

    return _opener.open(url, data, timeout)

  File "C:\Program Files (x86)\Python27\ArcGIS10.2\Lib\urllib2.py", line 410, in open

    response = meth(req, response)

  File "C:\Program Files (x86)\Python27\ArcGIS10.2\Lib\urllib2.py", line 523, in http_response

    'http', request, response, code, msg, hdrs)

  File "C:\Program Files (x86)\Python27\ArcGIS10.2\Lib\urllib2.py", line 448, in error

    return self._call_chain(*args)

  File "C:\Program Files (x86)\Python27\ArcGIS10.2\Lib\urllib2.py", line 382, in _call_chain

    result = func(*args)

  File "C:\Program Files (x86)\Python27\ArcGIS10.2\Lib\urllib2.py", line 531, in http_error_default

    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)

HTTPError: HTTP Error 400: Bad Request


Failed to execute (DownloadService).

Failed at Thu Nov 26 08:15:11 2015 (Elapsed Time: 1.94 seconds)

0 Kudos