Hi,
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:
my.idigi.com/ws/FileData/~/Device_ID/folder1/file1.xml
/file2.xml
/folder2/file3.xml
/file4.xml
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----------------------------------------------
USERNAME = Config.USERNAME
PASSWORD = Config.PASSWORD
IDIGI_URL = “my.idigi.com”
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"”)
webservice.endheaders()
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 = xml.read()
print xml_data