ArcGIS Notebook permissions error

564
2
08-27-2020 07:28 AM
Labels (1)
JoeBorgione
MVP Emeritus

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....
Tags (1)
0 Kudos
2 Replies
DanPatterson
MVP Esteemed Contributor

arcgis.gis module — arcgis 1.8.2 documentation 

Exports a service item to the specified export format. Available only to users with an organizational subscription. Invokable only by the service item owner or an administrator. This is useful for long running exports that could hold up a script.

The help is short on anything useful re examples.


... sort of retired...
JoeBorgione
MVP Emeritus

There does seem to be a lacking of practical examples.  It's just weird that I can manually do it, but the api errors out.  Hard saying where the disconnect is.

That should just about do it....
0 Kudos