Pydevice

Installation

Device Magic Devices API

>>> import json
>>> args = {'org_id': 800}
>>> dm = DeviceMagic(args)
>>>
>>> omaha_tablet = 281 # Device id
>>> new_device = 543
>>> old_device = 93
>>>
>>> dm.device.all() # All devices in organization
{'devices': [{'id': 281, 'identifier': 'Android_d5c2a9d...
>>>
>>> dm.device.details(omaha_tablet) # Device details
{'id': 281, 'identifier': 'Android_d5c2a9d...
>>>
>>> dm.device.delete(old_device)
>>>
>>> dm.device.approve(new_device)
>>>
>>> device_json = {
        'device':{
            'owner':'Audrey',
            'description':'Abroad helping others',
            'groups':'Outreach'
        }
    }
>>> device_json = json.dumps(device_json)
>>>
>>> dm.device.update(new_device, device_json) # Change device name, description and group(s)

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

Did this answer your question?