Skip to content

Latest commit

 

History

History
63 lines (46 loc) · 2.49 KB

device_pin.md

File metadata and controls

63 lines (46 loc) · 2.49 KB

Device Pins

Device pinning is a feature that allows enterprise admins to pin their user’s corporate-managed Box account to a particular mobile device or Box Sync client.

List Enterprise Device Pins

To retrieve all device pins for an enterprise, call client.device_pinners(enterprise=None, limit=None, marker=None, direction=None, fields=None). If an enterprise is not specified, this defaults to the current enterprise. This method returns a BoxObjectCollection that allows you to iterate over the DevicePinner objects in the collection.

device_pins = client.device_pinners()
for pin in device_pins:
    print(f'Pinned {pin.product_name} device for {pin.owned_by.name}')

Get Device Pin Information

To get information about a specific device pin, call device_pinner.get(*, fields=None, headers=None, **kwargs). This method returns a new DevicePinner object with fields populated by data from the API.

device_pin_id = '1111'
device_pin = client.device_pinner(device_pin_id).get()
print(f'{pin.product_name} device for {pin.owned_by.name} is pinned')

Delete Device Pin

To delete a specific device pin, call device_pinner.delete(). This method returns True to indicate that the deletion was successful.

device_pin_id = '1111'
client.device_pin(device_pin_id).delete()
print('Device pin deleted!')