Pydevice

Installation

Device Magic Dispatch API

Usage

>>> args = {'org_id': 600}
>>> dm = DeviceMagic(args)
>>>
>>> from some_file import dispatch_json
>>> new_brunswick_tab = 'Android_d5c2a9db-7c7e-465b'
>>> ontario_phone = 'iPhone_8775938_48795749'
>>> service_call = 13434 # Oneshot id
>>> old_dispatch = 11947
>>>
>>> dm.dispatch.all() # All outstanding dispatches
'[{"form": {"id": 72343, "name": "Daily Inspection","namespace"...'
>>>
>>> dm.dispatch.push(new_brunswick, dispatch_json) # Dispatch a form
>>>
>>> dm.dispatch.update(new_brunswick, service_call, dispatch_json)
>>>
>>> dm.dispatch.delete(ontario_phone, oneshot_id=old_dispatch) # Delete a single dispatch
>>>
>>> dm.dispatch.delete(ontario_phone) # Remove all

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

Did this answer your question?