I am trying to export the resources associated with AGOL items, using Jupyter Notebooks from desktop. This was previously working (over a year ago, just looking at it again now) but I'm now getting an error message: AttributeError: 'ResourceManager' object has no attribute 'export'
I used the guidance here for my script: https://developers.arcgis.com/python/guide/accessing-item-resources/ but whatever item I try I get that same error. I have tried items in my AGOL that I own and that definitely has resources associated with it.
Here is the code and error message:
sm_id = 'removedforprivacy'
sm_item = gis.content.get(sm_id)
print(sm_item)
sm_resources = sm_item.resources.list()
print(len(sm_resources), 'resources found for selected item')
sm_resources
folder_name = r"C:\\Documents\\ArcGIS Online Backups - JSON\\JSON_Backups_240229"
zip_name = "test_resources.zip"
sm_item.resources.export(save_path=folder_name, file_name=zip_name)
# Check that the current directory now has that zip output
os.path.isfile(zip_name)
<Item title:"Scottish Forestry GIS" type:StoryMap owner:deborah.hide_sf>
17 resources found for selected item
-------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-36-da62d89d44cd> in <module>()
30
31 zip_name = "test_resources.zip"
---> 32 sm_item.resources.export(save_path=folder_name, file_name=zip_name)
33
34 # Check that the current directory now has that zip output
AttributeError: 'ResourceManager' object has no attribute 'export'
I get the same error if I try it via an AGOL Notebook.
Does anyone know why this might be happening?