I'm experimenting with a simple notebook in my AGOL account, following this post How to download feature layer(s) to local machine using notebook as a template.
Here is the code. Each block is a notebook cell:
from arcgis.gis import GIS
gis = GIS('home')
item_id = '4f9d1d1301864f8cabef08cbae7b2d3c'
item = gis.content.get(item_id)
item_gdb = item.export(item.title + '_test', 'File Geodatabase')
It errors out at line 7 with:
Exception: You do not have permissions to access this resource or perform this operation.
(Error Code: 403)
What is odd about this is I can manually export the item from the item's details page without a problem, and the exported shapefile or gdb shows up in my root contents directory. I must be missing a simple step, but I don't know what it is.
That should just about do it....