7 years ago
parsing response
Hello All,
I need some help on the python 3. I am getting device information in response.content. I need to display only id from it. How to parse the response.content. I am using Python 3.5 o...
I don't really know python much but LM did state they will be providing a new Python SDK once v.113 is released (end of the month) which might make querying LM easier: https://www.logicmonitor.com/release-notes/v-113-release-notes/ . I haven't seen it myself.
Otherwise you may want to output/dump jsonResponse to make sure it's valid json (and not an http 501 error for example) or perhaps comment out the print line to see which line is causing the error? Perhaps you need to do ['data'][0]['id'] or the like? The API can return multiple devices. Again I don't really know python and I'm not currently setup to test with it.