Skip to content

Latest commit

 

History

History
93 lines (79 loc) · 2.71 KB

device-pins.md

File metadata and controls

93 lines (79 loc) · 2.71 KB

Device Pins

Device pins allow enterprises to control what devices can use native Box applications. To learn more about device pinning, please see the Device Pinning documentation.

Get Device Pin

To get information about a specific device pin, call the devicePins.get(pinID, options, callback) method with the ID of the device pin.

client.devicePins.get('11111')
    .then(pin => {
        /* pin -> {
            type: 'device_pinner',
            id: '11111',
            owned_by: 
            {
                type: 'user',
                id: '22222',
                name: 'Example User',
                login: '[email protected]'
            },
            product_name: 'iPad'
        }
        */
    });

Delete Device Pin

To remove a specific device pin, call the devicePins.delete(pinID, options, callback) method with the ID of the device pin.

client.devicePins.delete('28345')
    .then(() => {
        // deletion succeeded — no value returned
    });

Get All Device Pins

Get all device pins records for the current enterprise by calling the devicePins.getAll(options, callback) method.

client.devicePins.getAll()
    .then(pins => {
        /* pins -> {
            entries: 
            [ { type: 'device_pinner',
                id: '11111',
                owned_by: 
                    { type: 'user',
                    id: '22222',
                    name: 'Example User',
                    login: '[email protected]' },
                product_name: 'iPad' },
                { type: 'device_pinner',
                id: '11112',
                owned_by: 
                    { type: 'user',
                    id: '22222',
                    name: 'Example User',
                    login: '[email protected]' },
                product_name: 'iPhone' } ],
            limit: 100,
            order: [ { by: 'id', direction: 'ASC' } ] }
        */
    });