Pydevice

Installation

Device Magic Forms API

>>> args = {'org_id': 800}
>>> dm = DeviceMagic(args)
>>>
>>> from some_file import group_json
>>> site_survey = 400 # Form id
>>> old_form = 235
>>>
>>> dm.form.all() # All forms in organization
{'forms': [{'id': 400, 'name': 'Site Survey'...
>>>
>>> dm.form.details(site_survey)
{'type': 'root', 'children': [{'identifier': 'Time_on_site'...
>>>
>>> with open('form.json') as json:
...     dm.form.create(json.read())
...
'Form created'
>>>
>>> dm.form.update(site_survey, form_json)
>>>
>>> dm.form.delete(old_form)
>>>
>>> dm.form.new_group(site_survey, group_json) # Change form group

For a quick sample which doesn't utilize Pydevice, please visit this article.

Did this answer your question?