Pydevice

Installation

Device Magic Destinations API

Usage

>>> args = {'form_id': 700}
>>> dm = DeviceMagic(args)
>>>
>>> from some_file import destination_json
>>> docx_to_email = 17443 # Destination id
>>> google_sheet = 17465
>>> old_destination = 17432
>>> new_form = 8475
>>>
>>> dm.destination.all() # All form destinations
{'destinations': [{'id': 17442, 'description': None, 'active': True...}]}
>>>
>>> dm.destination.details(docx_to_email)
{'destination': {'id': 17443, 'description': '', 'active': True, 'form_id': 7225921, 'format_type': 'word_format', 'format_id': 14990, 'transport_type': 'email_transport'...
>>>
>>> dm.destination.create(destination_json) # Create a destination
>>>
>>> dm.destination.update(google_sheet, destination_json)
>>>
>>> dm.destination.delete(old_destination)
>>>
>>> dm.destination.copy(docx_to_email) # Copy a destination
>>> dm.destination.copy(docx_to_email, form_id=new_form) # Copy to another form

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

Did this answer your question?