jvseagle-co-nz-esridist

ArcGIS Online User Content Issue

Discussion created by jvseagle-co-nz-esridist Employee on Jul 4, 2013
Latest reply on Oct 22, 2013 by tony.gegneresri-se-esridist
Hi,

I have built automatic procedures using Python to create, delete, update, etc items on ArcGIS Online using its REST API.
Everything seems to work fine to the exception of one function.

Goal: List all the items inside of a folder in AGOL for Organizations

Because it doesn't seem to exist a method to list the items using the folders name I first need to make a request to get all the folders associated with my account/user to get their id.

That is done by invoking the URL below:
http://www.arcgis.com/sharing/rest/content/users/someuser  (the token and f=json are also added as request parameters)

Everything works fine. After discovering the ID of the folder I then issue a second request as follows:
http://www.arcgis.com/sharing/rest/content/users/someuser/some_folder_guid  (the token and f=json are also added as request parameters)

and I get the following error:
IncompleteRead(495 bytes read)

The call in Python is as follows:
urllib2.urlopen('https://www.arcgis.com/sharing/rest/content/users/' + portal_user + '/' + folder_id, urllib.urlencode(args)).read()

What actually happens is that read() function is what is taking more time. The code above is standard in python.
I have tested copying the request, args, and token into a browser and it seems to be returning the json properly.

If I catch the exception (e.g. except httplib.IncompleteRead, e :) and return the e.partial info it seems to have the entire json response. The problem is that it takes almost 1 minute to read it ... and I only have 1 item inside the folder. All other methods in AGOL seem to be fast except this one which is giving an exception...

Can you guys see why only this method is not working properly?

The create webmap, delete items, etc operations seems to be working properly ...

Thanks,
Jose Sousa






If I try to list the items

Outcomes