How to retreive multiple files/folders using httplib.HTTP method?


I tried to retrieve all the files and read the contents of all the files under each of my device folders under my iDigi account. Under each device folder, there are multiple folders, and under each of these folders, there are files.

The folder structure is like this:

I was not able to find a good way to do so.

I was able to read only the information of the Device_ID folder when I used the following Python scripts. Can anyone help on this? Thanks.

----------Python Scripts Below----------------------------------------------

auth = base64.encodestring(“%s:%s”%(USERNAME,PASSWORD))[:-1]

webservice = httplib.HTTP(IDIGI_URL,80)
webservice.putrequest(‘GET’, ‘/ws/FileData/~/%s’%Device_ID)
webservice.putheader(“Authorization”, “Basic %s”%auth)
webservice.putheader(“Content-type”, “text/xml; charset="UTF-8"”)

get the reply to the request

returncode, returnmsg, headers = webservice.getreply()

if successful, print out the contents of the XML file

if returncode == 200:
xml = webservice.getfile()
xml_data =
print xml_data

Have you seen these links:

They might be helpful in your case.

And these examples might also help you:

This is how you get list of all your deviceIDs:

This is how you get list of your folders and files for one deviceID:

This is how you download one file: