Options
All
  • Public
  • Public/Protected
  • All
Menu

Class devices

DeviceService allows the developer to manage devices such as iPads that have the Qminder Sign-In app installed, or Apple TVs with the Qminder TV app.

Hierarchy

  • devices

Index

Constructors

Methods

Constructors

constructor

Methods

Static details

  • Read the details of a particular TV based on its ID. Returns the ID, name, theme and settings of the TV.

    Calls the HTTP API: GET /v1/tv/<ID>

    For example:

    import * as Qminder from 'qminder-api';
    Qminder.setKey('API_KEY_HERE');
    const tv = await Qminder.devices.details(1425);
    
    throws

    Error if the TV ID is not provided.

    Parameters

    • tv: IdOrObject<Device>

      the Device that represents the TV, or the TV ID

    Returns Promise<Device>

    a Promise that resolves to device details, or rejects if something went wrong.

Static edit

  • edit(tv: IdOrObject<Device>, newName: string): Promise<Device>
  • Modify the TV's name. This changes the TV's display name in the TV List in the Qminder Dashboard.

    Calls the HTTP API: POST /v1/tv/<ID>

    For example:9

    import * as Qminder from 'qminder-api';
    Qminder.setKey('API_KEY_HERE');
    let device = Qminder.devices.details(1235);
    device = await Qminder.devices.edit(device, device.name + ' (Offsite)');
    
    throws

    Error if the TV ID and TV name are not provided.

    Parameters

    • tv: IdOrObject<Device>

      the Device that represents the TV, or the TV ID.

    • newName: string

      the desired new name of the TV.

    Returns Promise<Device>

    a Promise that resolves to the new TV details, or rejects if something went wrong.

Static remove

  • remove(tv: IdOrObject<Device>): Promise<{ statusCode: number }>
  • Remove a TV. This deletes the TV and revokes the API key, removing it from the list of TVs.

    Calls the HTTP API: DELETE /v1/tv/<ID>

    For example:

    import * as Qminder from 'qminder-api';
    Qminder.setKey('API_KEY_HERE');
    // Example 1. Delete based on device ID
    await Qminder.devices.remove(1235);
    // Example 2. Delete based on Device object
    const device = Qminder.devices.details(125);
    await Qminder.devices.remove(device);
    
    throws

    Error if the TV ID is not provided

    Parameters

    • tv: IdOrObject<Device>

      the Device that represents the TV, or the TV ID.

    Returns Promise<{ statusCode: number }>

    A promise that resolves when successful and rejects when something went wrong.

Generated using TypeDoc