@nuralogix.ai/dfx-api-client / HTTP / Devices

Devices

Devices end points

Devices can be used to record the platform by which a measurement captured was conducted on. The DeviceTypeID references a pre-defined set of devices with the following chart. New Device Types cannot be created by organizations and are managed by the API specifically. Devices types can be retrieved from a dedicated endpoint returning all their values and meanings.

Sample code

const apiClient = client();
const response = await apiClient.http.devices.retrieve('your-device-id');
const { status, body } = response;
if (status !== '200') {
    /**
     * TypeScript knows that once we are inside this block, the only response
     * shape that matches a non "200" response is the ErrorResponse
    */
    throw body;
}
/** Otherwise the shape of the response is DeviceRetrieve200Response */
console.log(body.StatusID);

Methods

create

create(data)

Creates a new device reference to associate with measurements. Each device is mapped to a device type ID.

Endpoint Action ID = 903

Parameters

NameType
dataDeviceCreateRequest

Returns

Promise<ErrorResponse | DeviceCreated200Response>


deleteDeviceMeasurement

deleteDeviceMeasurement(id)

Only DFX_ORG_ADMIN has permission to delete all measurements of a specific device for their own organization.

Endpoint Action ID = 907

Parameters

NameType
idstring

Returns

Promise<ErrorResponse | DeviceDeleteMeasurements200Response>


list

list(data)

Retrieves a list of existing devices in an organization.

Endpoint Action ID = 906

Parameters

NameType
dataDeviceListRequest

Returns

Promise<ErrorResponse | DeviceList200Response>


remove

remove(id)

Deletes a device from the dataset.

Endpoint Action ID = 905

Parameters

NameType
idstring

Returns

Promise<ErrorResponse | DeviceDeleted200Response>


retrieve

retrieve(id)

Retrieves a single reference to a device. The body response includes details about the device and the number of measurements that have been associated with it.

Endpoint Action ID = 902

Parameters

NameType
idstring

Returns

Promise<ErrorResponse | DeviceRetrieve200Response>


retrieveLicenseId

retrieveLicenseId()

We want to extend the EP to use deviceID (instead of {ID}) in the device token to extract license information and return to client.

Endpoint Action ID = 908

Returns

Promise<ErrorResponse | DeviceRetrieveLicenseId200Response>


types

types()

Retrieves a list of allowed device types.

Endpoint Action ID = 900

Returns

Promise<ErrorResponse | DeviceTypes200Response>


update

update(id, data)

Updates a device reference via the UUID supplied.

Endpoint Action ID = 904

Parameters

NameType
idstring
dataDeviceUpdateRequest

Returns

Promise<ErrorResponse | DeviceUpdated200Response>