DeepAffex™ Cloud API JavaScript Client Library

Description

The DeepAffex™ Cloud API JavaScript Client Library is designed for JavaScript client-application developers. It offers simple, flexible access to many DeepAffex APIs.

Installation

The main way that we ship our DeepAffex™ Cloud API code to NPM is as ECMAScript modules with ECMAScript 2022, the 13th edition syntax. This allows developers to take advantage of modern JavaScript features and have greater control over what they ship to their end users.

You can use either of the following methods to add the library to your project:

Package managers

# yarn
yarn add @nuralogix.ai/dfx-api-client

# npm
npm install @nuralogix.ai/dfx-api-client

Once added, then you can use it like this:

DeepAffex API JavaScript Client Library

Script tag

You can load them from popular CDNs such as skypack, JsDelivr and Unpkg.

<html>
  <body>
    <script type="module">
        import client from 'https://cdn.skypack.dev/@nuralogix.ai/dfx-api-client@1.0.0';
        const apiClient = client();

        const response = await apiClient.http.general.status();
        const { status, body } = response;
        if (status === '200') console.log(body.Version);
    </script>
  </body>
</html>

Getting started

This section will show you how to initialize and configure the library as well as working with the internal session.

Once you configured the library, you can call endpoints using either http or websocket transports.

Initialization

import client from '@nuralogix.ai/dfx-api-client';
const apiClient = client();

Though not necessary, you can also use the new keyword when initializing the client, if you like.

const apiClient = new client();

Setting custom URLs

By default, the http and WebSocket URLs are pre-configured as follows and there is no need to set them.

http: https://api.deepaffex.ai:9443
wss: wss://api.deepaffex.ai:9080

If you want to use a custom URL when you initialize the client then you can pass a URL object <IUrl> as follows:

const apiClient = client({
    url: {
        http: new URL('https://api.deepaffex.cn:9443'),
        wss: new URL('wss://api.deepaffex.cn:9080')
    }
});

If you want to use a custom URL after you initialized the client then you can pass a URL object <IUrl> as follows:

const apiClient = client();
apiClient.url = {
  http: new URL('https://api.deepaffex.cn:9443'),
  wss: new URL('wss://api.deepaffex.cn:9080')
}

Session

The library keeps an internal session <ISession> object and populates/clears some properties when different endpoints are called.

For example when http.organizations.registerLicense method is called then the deviceToken and deviceRefreshToken are set or when http.users.login is called then userToken and userRefreshToken are set.

If you want to manually set any of these properties, then you can do as follow:

const apiClient = client();
apiClient.session = { deviceToken: 'your-device-token'};

and the library will only update that single property keeping the other properties previously set intact.

You can also set multiple properties all at once. This is useful when you already

have this information stored in another location such as localStorage and want to load

them without making network calls:

const apiClient = client();
apiClient.session = { deviceToken: 'your-device-token', userToken: 'your-user-token' };

API

The NuraLogix DeepAffex™ Cloud API (DFX API) is used to analyze the facial blood-flow information extracted from images by the DeepAffex™ Extraction SDK. For an overview of DeepAffex™ technologies, please refer to our Developers Guide

You can call DeepAffex™ Cloud API endpoints using either HTTP or WebSocket transports:

The list of available interfaces is also shown in:

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

HTTP transport

The API is organized into groups composed of individual endpoints:

DeepAffex Cloud API groups:

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

General

General end points

Sample code

const apiClient = client();
const response = await apiClient.http.general.status();
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 GeneralStatus200Response */
console.log(body.Version);

Methods

listAcceptedMimeTypes

▸ listAcceptedMimeTypes()

Returns a list of system-wide accepted Mime types and their IDs.

Endpoint Action ID = 101

Returns

Promise<ErrorResponse | GeneralListAcceptedMIMETypes200Response>


listAvailableStatuses

▸ listAvailableStatuses()

Retrieves a list of available status codes that can be used throughout the application to update the StatusID field of various resources.

Endpoint Action ID = 104

Returns

Promise<ErrorResponse | GeneralListAvailableStatuses200Response>


listAvailableUserRoles

▸ listAvailableUserRoles()

Retrieves a list of available User Roles.

Endpoint Action ID = 102

Returns

Promise<ErrorResponse | GeneralListAvailableRoles200Response>


regions

▸ regions()

Return the list of regions available for clusters.

Endpoint Action ID = 108

Returns

Promise<ErrorResponse | GeneralRegions200Response>


status

▸ status()

An endpoint that propagates the current API health status and other information. This can be used during an apps initial boot process to determine the accessibility of the API and propagate a general status message to users.

Endpoint Action ID = 100

Returns

Promise<ErrorResponse | GeneralServerStatus200Response>


verifyToken

▸ verifyToken()

Checks validity of your Token and returns its encoded info.

Endpoint Action ID = 107

Returns

Promise<ErrorResponse | GeneralVerifyToken200Response>

@nuralogix.ai/dfx-api-client / HTTP / General / Interfaces

Interfaces

@nuralogix.ai/dfx-api-client / http / General / Interfaces / GeneralListAcceptedMIMETypes200Response

Interface: GeneralListAcceptedMIMETypes200Response

Properties

body

• body: GeneralMIMEType[]

List accepted Mime types


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / General / Interfaces / GeneralListAvailableRoles200Response

Interface: GeneralListAvailableRoles200Response

Properties

body

• body: GeneralRoles[]

List Available roles


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / General / Interfaces / GeneralListAvailableStatuses200Response

Interface: GeneralListAvailableStatuses200Response

Properties

body

• body: GeneralStatus[]

List Available Statuses


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / General / Interfaces / GeneralMIMEType

Interface: GeneralMIMEType

Properties

ID

• ID: string

GUID


Mime

• Mime: string


Name

• Name: string

@nuralogix.ai/dfx-api-client / HTTP / General / Interfaces / GeneralRegions

Interface: GeneralRegions

Properties

as-east

• as-east: "AS East"


as-hk

• as-hk: "AS Hong Kong"


cn-north

• cn-north: "cn-north-1"


cn-west

• cn-west: "cn-northwest-1"


eu-central

• eu-central: "EU Central"


na-east

• na-east: "NA East"


sa-east

• sa-east: "SA East"

@nuralogix.ai/dfx-api-client / HTTP / General / Interfaces / GeneralRegions200Response

Interface: GeneralRegions200Response

Properties

body

• body: GeneralRegions

Regions


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / General / Interfaces / GeneralRoles

Interface: GeneralRoles

Available Roles

Properties

Description

• Description: string


ID

• ID: string


Name

• Name: string

@nuralogix.ai/dfx-api-client / HTTP / General / Interfaces / GeneralServerStatus

Interface: GeneralServerStatus

Server Status response

Properties

AllowAnonymous

• AllowAnonymous: boolean

when false means that user login (and thus a user token) is required for making measurements.


Region

• Region: string

the location of the API by cluster


StatusID

• StatusID: "ACTIVE" | "MAINTENANCE" | "ERROR" | "LATENCY"

ACTIVE = Online and fully operational

MAINTENANCE = Offline for maintenance

ERROR = Offline due to an error

LATENCY = API is experience latency or a general slowdown


Version

• Version: string

API version

@nuralogix.ai/dfx-api-client / HTTP / General / Interfaces / GeneralStatus200Response

Interface: GeneralServerStatus200Response

Properties

body

• body: GeneralServerStatus

Server Status


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / General / Interfaces / GeneralStatus

Interface: GeneralStatus

Available Status

Properties

Description

• Description: string


ID

• ID: string


Name

• Name: string

@nuralogix.ai/dfx-api-client / HTTP / General / Interfaces / GeneralVerifyToken

Interface: GeneralVerifyToken

Properties

ActiveLicense

• ActiveLicense: boolean


DeviceID

• DeviceID: string


ID

• ID: string


OrganizationID

• OrganizationID: string


Region

• Region: string


RemainingMeasurement

• RemainingMeasurement: null | number


RoleID

• RoleID: string


SessionGen

• SessionGen: number


Type

• Type: string


exp

• exp: number


iat

• iat: number


iss

• iss: string

@nuralogix.ai/dfx-api-client / HTTP / General / Interfaces / GeneralVerifyToken200Response

Interface: GeneralVerifyToken200Response

Properties

body

• body: GeneralVerifyToken

Verify token


status

• status: "200"

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

Users

Users end points

Sample code

const apiClient = client();
const response = await apiClient.http.users.retrieve();
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 UserAccountInfo200Response */
console.log(body.FirstName);

Methods

changePassword

▸ changePassword(data)

This End Point allow user to change password for already verified user.

Endpoint Action ID = 220

Parameters

NameType
dataUserChangePasswordRequest

Returns

Promise<ErrorResponse | UserChangePassword200Response>


create

▸ create(data)

Creates a new user in the organization, checking for existing user details against the user list. Email + Password OR PhoneNumber fields are required. If both are provided, Email + Password will be used to create User account. The rest of the fields are optional. Endpoint Action ID = 200

Parameters

NameType
dataUserCreateRequest

Returns

Promise<ErrorResponse | UserCreate200Response>


createTwoFactorAuthSecret

▸ createTwoFactorAuthSecret()

Creates a base32 secret, url and a QR code (both derived from the secret) that are compatible with Google Authenticator or similar two-factor token generation application. The secret can be used to enable 2FA for given user, and QR code can be used to configure compatible application to generate login tokens for it. This is the first of two API calls needed to configure 2FA for a user.

Endpoint Action ID = 221

Returns

Promise<ErrorResponse | UserCreateTwoFactorAuthSecret200Response>


delete

▸ delete(userId)

Only DFX_ORG_ADMIN has permission to delete all measurement of specific user for its own organization.

Endpoint Action ID = 219

Parameters

NameType
userIdstring

Returns

Promise<ErrorResponse | UserDelete200Response>


disableTwoFactorAuthForLoggedInUser

▸ disableTwoFactorAuthForLoggedInUser()

Disables 2FA for logged in user.

Endpoint Action ID = 223

Returns

Promise<ErrorResponse | UserDisableTwoFactorAuthForLoggedInUser200Response>


disableTwoFactorAuthForSpecifiedUser

▸ disableTwoFactorAuthForSpecifiedUser(userId)

Disables 2FA for user by its ID. This is a privileged operation that requires ORG_ADMIN permissions.

Endpoint Action ID = 224

Parameters

NameType
userIdstring

Returns

Promise<ErrorResponse | UserDisableTwoFactorAuthForSpecifiedUser200Response>


enableTwoFactorAuthForLoggedInUser

▸ enableTwoFactorAuthForLoggedInUser(data)

Enables 2FA for logged in user using an MFASecret (created by /users/mfa/secret endpoint) and MFAToken (derived from MFASecret by scanning a QR code by Google Authenticator or compatible app).

This is the second of two API calls needed to configure 2FA for a user.The complete workflow would be as follows:

  • Logged in user calls /users/mfa/enable and stores secretBase32Encoded and qrcode properties.
  • User scans qrcode by 2FA token generation app.
  • User POSTs secretBase32Encoded as MFASecret and 2FA app temporary token as MFAToken to /users/mfa/enable endpoint.

Endpoint Action ID = 222

Parameters

NameType
dataUserTwoFactorAuthForLoggedInUserRequest

Returns

Promise<ErrorResponse | UserEnableTwoFactorAuthForLoggedInUser200Response>


login

▸ login(data)

Logs a user into a new session using Email, Password and optionally an MFAToken and responds with a User Token. The Token must be passed to every subsequent API call to the server.

Note: you need to obtain a Device Token first to be able to login through this endpoint.

Note: MFAToken token is mandatory when Multi-factor authentication is enabled for this user.

Endpoint Action ID = 201

Parameters

NameType
dataUserLoginRequest

Returns

Promise<ErrorResponse | UserLogin200Response>


loginWithPhoneCode

▸ loginWithPhoneCode(data)

Use previously requested 6-digit code to login into a new session and obtain UserToken.

Endpoint Action ID = 217

Parameters

NameType
dataUserLoginWithPhoneCodeRequest

Returns

Promise<ErrorResponse | UserLoginWithPhoneCode200Response>


logout

▸ logout()

Logs user out from all its sessions at once.

Endpoint Action ID = 226

Returns

Promise<ErrorResponse | UserLogout200Response>


remove

▸ remove()

Removes the entire user account, profiles, and all measurement data associated with it. The account to be deleted is derived from the User Token.

Endpoint Action ID = 206

Returns

Promise<ErrorResponse | UserRemove200Response>


retrieve

▸ retrieve()

Retrieves User account information based on the provided User Token.

Endpoint Action ID = 202

Returns

Promise<ErrorResponse | UserAccountInfo200Response>


retrieveUserRole

▸ retrieveUserRole()

Retrieves User's Role.

Endpoint Action ID = 211

Returns

Promise<ErrorResponse | UserRetrieveRole200Response>


sendAccountActivationCode

▸ sendAccountActivationCode(userId)

Sends an account verification code to the user's email address. The code is used to verify the account through the account verification endpoint.

Endpoint Action ID = 213

Parameters

NameType
userIdstring

Returns

Promise<ErrorResponse | UserAccountVerificationCode200Response>


update

▸ update(data)

Updates a user's account information with new details. This endpoint will only update fields supplied to it, hence sending only First Name or Last Name will exclusively update those values.

Endpoint Action ID = 208

Parameters

NameType
dataUserUpdateRequest

Returns

Promise<ErrorResponse | UserUpdate200Response>


verifyUserAccount

▸ verifyUserAccount(data)

Verifies User's email address.

Endpoint Action ID = 212

Parameters

NameType
dataUserVerifyRequest

Returns

Promise<ErrorResponse | UserVerify200Response>

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces

Interfaces

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserAccountInfo200Response

Interface: UserAccountInfo200Response

Properties

body

• body: UserAccountInformation

User account information


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserAccountInformation

Interface: UserAccountInformation

User account information

Properties

AvatarURI

• AvatarURI: null | string


Created

• Created: number


DateOfBirth

• DateOfBirth: string


DeviceID

• DeviceID: null | string


Email

• Email: string


FirstName

• FirstName: string


Gender

• Gender: string


HeightCm

• HeightCm: null | string


ID

• ID: string


IsVerified

• IsVerified: boolean


LastName

• LastName: string


LoginMethod

• LoginMethod: string


MFAEnabled

• MFAEnabled: boolean


OrganizationID

• OrganizationID: string


Password

• Password: string


PhoneNumber

• PhoneNumber: null | string


Region

• Region: string


ResetToken

• ResetToken: null | string


ResetTokenDate

• ResetTokenDate: null | string


RoleID

• RoleID: string


SSOID

• SSOID: null | string


StatusID

• StatusID: string


Updated

• Updated: number


VerificationCode

• VerificationCode: null | string


WeightKg

• WeightKg: null | string

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserAccountVerificationCode

Interface: UserAccountVerificationCode

User verify

Properties

Message

• Message: string


success

• success: boolean

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserAccountVerificationCode200Response

Interface: UserAccountVerificationCode200Response

Properties

body

• body: UserAccountVerificationCode

User account verification code


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserAuthenticated

Interface: UserAuthenticated

Authenticated user

Properties

RefreshToken

• RefreshToken: string


Token

• Token: string

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserChangePassword

Interface: UserChangePassword

User change password

Properties

Properties

success

• success: boolean

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserChangePassword200Response

Interface: UserChangePassword200Response

Properties

body

• body: UserChangePassword

User change password response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserChangePasswordRequest

Interface: UserChangePasswordRequest

User change password request

Properties

Email

• Email: string


Identifier

• Identifier: string


NewPassword

• NewPassword: string


Password

• Password: string

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserCreate200Response

Interface: UserCreate200Response

Properties

body

• body: UserCreated

User create response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserCreated

Interface: UserCreated

User created

Properties

ID

• ID: string

New user GUID

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserCreateRequest

Interface: UserCreateRequest

User create request

Properties

DateOfBirth

• Optional DateOfBirth: string


Email

• Email: string


FirstName

• Optional FirstName: string


Gender

• Optional Gender: string


HeightCm

• Optional HeightCm: string


LastName

• Optional LastName: string


Password

• Password: string


PhoneNumber

• PhoneNumber: string


WeightKg

• Optional WeightKg: string

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserCreateTwoFactorAuthSecret200Response

Interface: UserCreateTwoFactorAuthSecret200Response

Properties

body

• body: UserCreateTwoFactorAuthSecretRequest

User create two-factor auth secret response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserCreateTwoFactorAuthSecretRequest

Interface: UserCreateTwoFactorAuthSecretRequest

User create two-factor auth secret request

Properties

qrcode

• qrcode: string


secretBase32Encoded

• secretBase32Encoded: string


url

• url: string

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserDelete200Response

Interface: UserDelete200Response

Properties

status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserDisableTwoFactorAuthForLoggedInUser

Interface: UserDisableTwoFactorAuthForLoggedInUser

User disable two-factor auth for logged in user

Properties

success

• success: boolean

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserDisableTwoFactorAuthForLoggedInUser200Response

Interface: UserDisableTwoFactorAuthForLoggedInUser200Response

Properties

body

• body: UserDisableTwoFactorAuthForLoggedInUser

User disable wo-factor auth for logged in user response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserDisableTwoFactorAuthForSpecifiedUser

Interface: UserDisableTwoFactorAuthForSpecifiedUser

User disable two-factor auth for specified user

Properties

success

• success: boolean

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserDisableTwoFactorAuthForSpecifiedUser200Response

Interface: UserDisableTwoFactorAuthForSpecifiedUser200Response

Properties

body

• body: UserDisableTwoFactorAuthForSpecifiedUser

User disable wo-factor auth for specified user response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserEnableTwoFactorAuthForLoggedInUser

Interface: UserEnableTwoFactorAuthForLoggedInUser

User enable two-factor auth for logged in user

Properties

success

• success: boolean

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserEnableTwoFactorAuthForLoggedInUser200Response

Interface: UserEnableTwoFactorAuthForLoggedInUser200Response

Properties

body

• body: UserEnableTwoFactorAuthForLoggedInUser

User enable two-factor auth for logged in user response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserLogin200Response

Interface: UserLogin200Response

Properties

body

• body: UserAuthenticated

User login response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserLoginRequest

Interface: UserLoginRequest

User login request

Properties

Email

• Email: string


MFAToken

• Optional MFAToken: string


Password

• Password: string

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserLoginWithPhoneCode

Interface: UserLoginWithPhoneCode

User login with phone code

Properties

RefreshToken

• RefreshToken: string


Token

• Token: string

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserLoginWithPhoneCode200Response

Interface: UserLoginWithPhoneCode200Response

Properties

body

• body: UserLoginWithPhoneCode

User login with phone code response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserLoginWithPhoneCodeRequest

Interface: UserLoginWithPhoneCodeRequest

User login with phone code request

Properties

LoginCode

• LoginCode: number


OrgKey

• OrgKey: string


PhoneNumber

• PhoneNumber: string

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserLogout

Interface: UserLogout

User logout

Properties

success

• success: boolean

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserLogout200Response

Interface: UserLogout200Response

Properties

body

• body: UserLogout

User logout response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserRemove200Response

Interface: UserRemove200Response

Properties

status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserRetrieveRole200Response

Interface: UserRetrieveRole200Response

Properties

body

• body: UserRole

User role response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserRole

Interface: UserRole

User role

Properties

Description

• Description: string


ID

• ID: string


Name

• Name: string


Organization

• Organization: string

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserTwoFactorAuthForLoggedInUserRequest

Interface: UserTwoFactorAuthForLoggedInUserRequest

User Enable Two-factor authentication for logged in user request

Properties

MFASecret

• MFASecret: string


MFAToken

• MFAToken: number

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserUpdate200Response

Interface: UserUpdate200Response

Properties

status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserUpdateRequest

Interface: UserUpdateRequest

User update request

Properties

DateOfBirth

• Optional DateOfBirth: string


Email

• Email: string


FirstName

• Optional FirstName: string


Gender

• Optional Gender: string


HeightCm

• Optional HeightCm: string


LastName

• Optional LastName: string


Password

• Password: string


PhoneNumber

• PhoneNumber: string


WeightKg

• Optional WeightKg: string

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserVerify

Interface: UserVerify

User verify

Properties

success

• success: boolean

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserVerify200Response

Interface: UserVerify200Response

Properties

body

• body: UserVerify

User verify response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Users / Interfaces / UserVerifyRequest

Interface: UserVerifyRequest

User verify request

Properties

ID

• ID: string


VerificationCode

• VerificationCode: string

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

Profiles

Profiles end points

Profiles are elements of user accounts. A single user account may maintain a number of profiles to help segment different types of users.

Sample code

const apiClient = client();
const response = await apiClient.http.profiles.retrieve('your-profile-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 ProfileRetrieve200Response */
console.log(body.Name);

Methods

create

▸ create(data)

Creates a user profile under a main user account. User profiles may be used to segment different accounts for measurements.

Endpoint Action ID = 400

Parameters

NameType
dataProfileCreateRequest

Returns

Promise<ErrorResponse | ProfileCreate200Response>


list

▸ list(data)

Lists specific profiles managed under the current user account.

Endpoint Action ID = 402

Parameters

NameType
dataProfileListRequest

Returns

Promise<ErrorResponse | ProfileList200Response>


listByUser

▸ listByUser(userId, data)

Lists specific profiles managed under a single user account specified by the ID in the request parameters.

Endpoint Action ID = 403

Parameters

NameType
userIdstring
dataProfileListByUserRequest

Returns

Promise<ErrorResponse | ProfileListByUser200Response>


remove

▸ remove(profileId)

Removes the user profile entirely. It also deletes any related meta fields associated with the profile.

Endpoint Action ID = 404

Parameters

NameType
profileIdstring

Returns

Promise<ErrorResponse | ProfileRemove200Response>


retrieve

▸ retrieve(profileId)

Retrieves a single user Profile specified by ID.

Endpoint Action ID = 401

Parameters

NameType
profileIdstring

Returns

Promise<ErrorResponse | ProfileRetrieve200Response>


update

▸ update(profileId, data)

Updates a specific user profile. To update status the valid options are: ACTIVE and INACTIVE.

Endpoint Action ID = 405

Parameters

NameType
profileIdstring
dataProfileUpdateRequest

Returns

Promise<ErrorResponse | ProfileUpdate200Response>

@nuralogix.ai/dfx-api-client / HTTP / Profiles / Interfaces

Interfaces

@nuralogix.ai/dfx-api-client / HTTP / Profiles / Interfaces / ProfileCreate200Response

Interface: ProfileCreate200Response

Properties

body

• body: ProfileCreated

Profile created response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Profiles / Interfaces / ProfileCreated

Interface: ProfileCreated

Profile created

Properties

ID

• ID: string

@nuralogix.ai/dfx-api-client / HTTP / Profiles / Interfaces / ProfileCreateRequest

Interface: ProfileCreateRequest

Profile create request

Properties

Email

• Email: string


Name

• Name: string

@nuralogix.ai/dfx-api-client / HTTP / Profiles / Interfaces / ProfileList

Interface: ProfileList

Profile list

Properties

Created

• Created: number


Email

• Email: string


ID

• ID: string


MeasurementCount

• MeasurementCount: number


Name

• Name: string


OwnerUserEmail

• OwnerUserEmail: string


Status

• Status: string


TotalCount

• TotalCount: string


Updated

• Updated: number

@nuralogix.ai/dfx-api-client / HTTP / Profiles / Interfaces / ProfileList200Response

Interface: ProfileList200Response

Properties

body

• body: ProfileList[]

Profile list response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Profiles / Interfaces / ProfileListByUser200Response

Interface: ProfileListByUser200Response

Properties

body

• body: ProfileRetrieve[]

Profile list by user response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Profiles / Interfaces / ProfileListByUserRequest

Interface: ProfileListByUserRequest

Profile list request

Properties

limit

• limit: number

default 25


offset

• offset: number

default 0


status

• status: string


userProfileName

• userProfileName: string

@nuralogix.ai/dfx-api-client / HTTP / Profiles / Interfaces / ProfileListRequest

Interface: ProfileListRequest

Profile list request

Properties

limit

• limit: number

default 25


offset

• offset: number

default 0


status

• status: string


userProfileName

• userProfileName: string

@nuralogix.ai/dfx-api-client / HTTP / Profiles / Interfaces / ProfileRemove200Response

Interface: ProfileRemove200Response

Properties

status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Profiles / Interfaces / ProfileRetrieve

Interface: ProfileRetrieve

Profile retrieve

Properties

Created

• Created: number


Email

• Email: string


ID

• ID: string


MeasurementCount

• MeasurementCount: number


Name

• Name: string


Status

• Status: string


Updated

• Updated: number

@nuralogix.ai/dfx-api-client / HTTP / Profiles / Interfaces / ProfileRetrieve200Response

Interface: ProfileRetrieve200Response

Properties

body

• body: ProfileRetrieve

Profile retrieve response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Profiles / Interfaces / ProfileUpdate200Response

Interface: ProfileUpdate200Response

Properties

status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Profiles / Interfaces / ProfileUpdateRequest

Interface: ProfileUpdateRequest

Profile update request

Properties

Email

• Email: string


Name

• Name: string


Status

• Status: string

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

Measurements

Measurements end points

Measurements are individual one-time captures of blood flow data. A single measurement record could represent multiple models of data analysis, hence this data structure supports lookup parameters to filter them.

Note: A valid License is required in order to create Measurements and submit data chunks for processing. Please make sure to call Register License endpoint first to receive a Device Token that grants access to these functions. Next, in order to have your user information associated with the measurements, you can use User Login endpoint to obtain a User Token, which can be used to take measurements as well.

Important: If your License Type is SDK_DEVICE, you must login and obtain a User Token as this License Type only allows to perform a login operation.

Sample code

const apiClient = client();
const response = await apiClient.http.measurements.retrieve('your-measurement-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 MeasurementRetrieved200Response */
console.log(body.StatusID);

Methods

create

▸ create(data)

Begins a new data capture session and returns a measurement ID property, which should be referenced for adding data chunks and retreiving results.

Resolution: currently can be either 0 or 100. (default is 100)

  • 100 means the result set will have 100% of the original size

  • 0 returns 1 value per signal

PartnerID is mandatory or optional (based on License policy).

Endpoint Action ID = 504

Parameters

NameType
dataMeasurementCreateRequest

Returns

Promise<ErrorResponse | MeasurementCreated200Response>


data

▸ data(id, data)

Adds collected blood-flow data to a specific measurement. Upon submitting a chunk of data, the API will return a MeasurementDataID value representing the received chunk. Data must be sent to the server in the order produced by the DFX SDK. If a chunk it sent out of order, the server will return an error. Please ensure that new chunks are only sent after the server responds with a MeasurementDataID.

Submitting measurements has three stages:

a) starting,

b) measurement body,

c) closing a measurement.

Each of these phases have the same payload structure however a different Action flag is to be sent with each request and must follow the CHUNK::ACTION format.

Measurement Actions | Description

FIRST::PROCESS | Start a new measurement (drop any existing), Process results

FIRST::IGNORE | Start a new measurement (drop any existing), Do not process

CHUNK::PROCESS | Arbitrary block of TOI data and process results

CHUNK::IGNORE | Arbitrary block of TOI data and do not process results

LAST::PROCESS | Finish a measurement cycle and process results

LAST::IGNORE | Finish a measurement cycle and do not process

Payload is binary data that can currently only be obtained by using our SDK. The Payload (binary content) field must be base64-encoded.

Note: This endpoint is a subject to request throttling, you must not submit more data than can be obtained in real time. i.e., do not send more than five seconds of chunk data over the course of five seconds of real time.

Response Error Codes Explanation:

  • "RATE_LIMIT": You have sent too many chunks in a given time period. See the Note above.
  • "MEASUREMENT_CLOSED": Requested Measurement is already finished. You need to create a new Measurement.
  • "MISALIGNED_CHUNK": Chunk Order was mismatched. i.e., ChunkOrder 2 was sent before ChunkOrder 1.
  • "INVALID_MEASUREMENT": Requested Measurement ID was not found.
  • "UNPACKER_RPC_ERROR": Payload validation has been failed. Reason(s) will be provided in error message.

Endpoint Action ID = 506

Parameters

NameType
idstring
dataMeasurementAddDataRequest

Returns

Promise<ErrorResponse | MeasurementAddData200Response>


delete

▸ delete(id)

Only DFX_ORG_ADMIN has permission to delete a specific measurment by measurement ID for its own organization.

Endpoint Action ID = 507

Parameters

NameType
idstring

Returns

Promise<ErrorResponse | MeasurementDelete200Response>


list

▸ list(data)

Provides a historical list of measurements captured by the API store. The results of the measurements are captured and only displayed for the current application providers token designator. Each record has a status representing its cycle in the system:

Status Message | Description

  • CAPTURING | A new record was created and results are being received.
  • PROCESSING | Capture is complete and the record is processing.
  • COMPLETE | The analysis is complete and ready for consumption.
  • ERROR | An error occurred during processing.
  • INCOMPLETE | Capturing process returned as incomplete/not enough data.

Endpoint Action ID = 501

Parameters

NameType
dataMeasurementListRequest

Returns

Promise<ErrorResponse | MeasurementList200Response>


retrieve

▸ retrieve(id)

Returns the results of a measurement request specified by the UUID in the endpoint request. This payload will change according to the different requested signals.

Endpoint Action ID = 500

Parameters

NameType
idstring

Returns

Promise<ErrorResponse | MeasurementRetrieved200Response>

@nuralogix.ai/dfx-api-client / HTTP / Measurements / Interfaces

Interfaces

@nuralogix.ai/dfx-api-client / HTTP / Measurements / Interfaces / MeasurementAddData

Interface: MeasurementAddData

Measurement add data

Properties

ChunkOrder

• ChunkOrder: number


ID

• ID: string

@nuralogix.ai/dfx-api-client / HTTP / Measurements / Interfaces / MeasurementAddData200Response

Interface: MeasurementAddData200Response

Properties

body

• body: MeasurementAddData

Measurement add data response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Measurements / Interfaces / MeasurementAddDataRequest

Interface: MeasurementAddDataRequest

Measurement add data request

Properties

Action

• Action: string


Payload

• Payload: string

Base64-encoded payload

@nuralogix.ai/dfx-api-client / HTTP / Measurements / Interfaces / MeasurementCreated

Interface: MeasurementCreated

Measurement Created

Properties

ID

• ID: string

@nuralogix.ai/dfx-api-client / HTTP / Measurements / Interfaces / MeasurementCreated200Response

Interface: MeasurementCreated200Response

Properties

body

• body: MeasurementCreated

Measurement Created response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Measurements / Interfaces / MeasurementCreateRequest

Interface: MeasurementCreateRequest

Measurement create request

Properties

PartnerID

• Optional PartnerID: string

Optional or mandatory depending on license policy


Resolution

• Resolution: number


StudyID

• StudyID: string


UserProfileID

• Optional UserProfileID: string

User Profile ID (optional)

@nuralogix.ai/dfx-api-client / HTTP / Measurements / Interfaces / MeasurementDelete200Response

Interface: MeasurementDelete200Response

Properties

status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Measurements / Interfaces / MeasurementList

Interface: MeasurementList

Measurement list

Properties

Created

• Created: number


DeviceID

• DeviceID: null | string


DeviceVersion

• DeviceVersion: null | string


ID

• ID: string


Mode

• Mode: string


StatusID

• StatusID: string


StudyID

• StudyID: string


TotalCount

• TotalCount: number


Updated

• Updated: number


UserID

• UserID: string


UserProfileID

• UserProfileID: null | string


UserProfileName

• UserProfileName: null | string

@nuralogix.ai/dfx-api-client / HTTP / Measurements / Interfaces / MeasurementList200Response

Interface: MeasurementList200Response

Properties

body

• body: MeasurementList[]

Measurement retrieved response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Measurements / Interfaces / MeasurementListRequest

Interface: MeasurementListRequest

Measurement list request

Properties

date

• date: null | string


endDate

• endDate: null | string


limit

• limit: null | string


offset

• offset: null | string


partnerId

• partnerId: null | string


statusId

• statusId: null | string


studyId

• studyId: null | string


userProfileId

• userProfileId: null | string


userProfileName

• userProfileName: null | string

@nuralogix.ai/dfx-api-client / HTTP / Measurements / Interfaces / MeasurementRetrieve

Interface: MeasurementRetrieve

Measurement retrieve

Table of contents

Properties

City

• City: string


Comments

• Comments: Object


Country

• Country: string


Created

• Created: number


DataSizeBytes

• DataSizeBytes: number


DeviceID

• DeviceID: string


DeviceVersion

• DeviceVersion: string


ID

• ID: string


Mode

• Mode: string


OrganizationID

• OrganizationID: string


PartnerID

• PartnerID: string


Region

• Region: string


Resolution

• Resolution: number


Results

• Results: Object


SignalConfig

• SignalConfig: Object


SignalDescriptions

• SignalDescriptions: Object


SignalNames

• SignalNames: Object


SignalUnits

• SignalUnits: Object


State

• State: string


StatusID

• StatusID: string


StudyID

• StudyID: string


Updated

• Updated: number


UserID

• UserID: string


UserProfileID

• UserProfileID: string

@nuralogix.ai/dfx-api-client / HTTP / Measurements / Interfaces / MeasurementRetrieved200Response

Interface: MeasurementRetrieved200Response

Properties

body

• body: MeasurementRetrieve

Measurement retrieved response


status

• status: "200"

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

Organizations

Organizations end points

This set of endpoints covers functions that allow to access resources on the Organizational level. All endpoints require Researcher, Lead or Admin access.

Sample code

const apiClient = client();
const response = await apiClient.http.organizations.retrieveLogo('your-org-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 OrgLogo200Response */
console.log(body.data);

Methods

createUser

▸ createUser(data)

Creates a user under the organization. Available only to an Administrator.

An email will be sent to submitted Email address with a link to setup password for the account. To create a user under your organization. You will need to be logged in as a DFX_LEAD, DFX_ORG_ADMIN

Endpoint Action ID = 713

Parameters

NameType
dataOrgCreateUserRequest

Returns

Promise<ErrorResponse | OrgCreateUser200Response>


deleteOrgMeasurement

▸ deleteOrgMeasurement(orgId)

Only DFX_ORG_ADMIN has permission to delete all measurment for their own organization.

Endpoint Action ID = 721

Parameters

NameType
orgIdstring

Returns

Promise<ErrorResponse | OrgDeleteSelfMeasurements200Response>


deletePartnerMeasurement

▸ deletePartnerMeasurement(orgId, partnerId)

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

Endpoint Action ID = 722

Parameters

NameType
orgIdstring
partnerIdstring

Returns

Promise<ErrorResponse | OrgDeletePartnerMeasurements200Response>


listMeasurements

▸ listMeasurements(data)

Similar to measurements.list endpoint but retrieves all measurements across an Organization.

Accessible by users with Researcher or Admin role.

Endpoint Action ID = 703

Parameters

NameType
dataOrgMeasurementsRequest

Returns

Promise<ErrorResponse | OrgRegisterLicense200Response>


listProfiles

▸ listProfiles(data)

Similar to profiles.list endpoint but retrieves profiles across the Organization.

Accessible by users with Researcher or Admin role.

Endpoint Action ID = 710

Parameters

NameType
dataOrgListProfileRequest

Returns

Promise<ErrorResponse | OrgListProfiles200Response>


login

▸ login(data)

Login and obtain User Token.

Note: Token obtained from this endpoint does not allow you to take Measurements and is intended for viewing purposes only.

Note: MFAToken parameter is required only when 2FA authentication is enabled.

Endpoint Action ID = 717

Parameters

NameType
dataOrgLoginRequest

Returns

Promise<ErrorResponse | OrgLogin200Response>


registerLicense

▸ registerLicense(data)

Allows consumers to exchange a license key for a device token.

This endpoint is accessible publically to all consuming clients. License keys are mapped against an organization. Upon submitting a registration key and relevant information associated with the device to be registered, DFX API will respond with a referencing DeviceID and a token for future device-specific API requests. The resulting token is a Device Token.

The longevity and allowed origins of the token can be controlled by TokenExpiresIn and TokenSubject optional parameters.

TokenExpiresIn specifies token validity duration in seconds. Effective duration will be calculated as a minimum of TokenExpiresIn, license Expiration date and organization's SessionMaxDurationseconds; i.e., this parameter can only be used to further reduce token's lifespan.

TokenSubject locks the host which is allowed to use the token for its communication with DeepAffex. When set, the server will compare the token value with HTTP request's Referer header and reject the request if those don't match.

Note: Please make sure to store the obtained token locally as most Licenses (e.g. Trial) allow for a limited number of registered Devices. To unregister a Device and get back one license, call the unregisterLicense method with your Device Token.

Endpoint Action ID = 705

Parameters

NameType
dataOrgRegisterLicenseRequest

Returns

Promise<ErrorResponse | OrgRegisterLicense200Response>


removeUser

▸ removeUser(userId)

Similar to users.remove endpoint but performed by an Organization's Admin.

Accessible only by users with Admin role.

Endpoint Action ID = 715

Parameters

NameType
userIdstring

Returns

Promise<ErrorResponse | OrgDeleteUser200Response>


retrieve

▸ retrieve()

Retrieves information related to the current organization account.

Endpoint Action ID = 700

Returns

Promise<ErrorResponse | OrgRetrieveInformation200Response>


▸ retrieveLogo(orgId)

Retrieves an Organization logo. This endpoint will return a buffer containing a logo

Endpoint Action ID = 708

Parameters

NameType
orgIdstring

Returns

Promise<ErrorResponse | OrgLogo200Response>


retrieveMeasurement

▸ retrieveMeasurement(measurementId)

Similar to measurements.retrieve endpoint but retrieves a measurement across the Organization.

Accessible by users with Researcher or Admin role.

Endpoint Action ID = 704

Parameters

NameType
measurementIdstring

Returns

Promise<ErrorResponse | OrgRetrieveMeasurement200Response>


retrieveProfile

▸ retrieveProfile(profileId)

Similar to profiles.retrieve endpoint but retrieves a profile from the Organization

Accessible by users with Researcher or Admin role.

Endpoint Action ID = 711

Parameters

NameType
profileIdstring

Returns

Promise<ErrorResponse | OrgRetrieveProfile200Response>


retrieveUser

▸ retrieveUser(userId)

Similar to users.retrieve endpoint but retrieves a user from the Organization.

Accessible only by users with Admin role.

Endpoint Action ID = 712

Parameters

NameType
userIdstring

Returns

Promise<ErrorResponse | OrgRetrieveUser200Response>


unregisterLicense

▸ unregisterLicense()

Send the Device Token as the Authorization header to decommission a registered device.

Note that this does not delete the Device.

Endpoint Action ID = 706

Returns

Promise<ErrorResponse | OrgUnregisterLicense200Response>


updateProfile

▸ updateProfile(profileId, data)

Similar to profiles.update endpoint but updates a Profile from the Organization.

Accessible by users with Researcher or Admin role.

Endpoint Action ID = 716

Parameters

NameType
profileIdstring
dataOrgUpdateProfileRequest

Returns

Promise<ErrorResponse | OrgUpdateProfile200Response>


updateUser

▸ updateUser(userId, data)

Similar to users.update endpoint but updates a User from the Organization.

Accessible only by users with Admin role.

Endpoint Action ID = 714

Parameters

NameType
userIdstring
dataOrgUpdateUserRequest

Returns

Promise<ErrorResponse | OrgUpdateUser200Response>


users

▸ users(data)

Retrieves a list of users in the current organization.

This endpoint can filter by groups and account creation start and end dates to make sorting and filtering easier.

Endpoint Action ID = 702

Parameters

NameType
dataOrgUsersRequest

Returns

Promise<ErrorResponse | OrgRegisterLicense200Response>

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces

Interfaces

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgCreateUser

Interface: OrgCreateUser

Properties

ID

• ID: string


ResetToken

• ResetToken: string

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgCreateUser200Response

Interface: OrgCreateUser200Response

Properties

body

• body: OrgCreateUser

Organization create user response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgCreateUserRequest

Interface: OrgCreateUserRequest

Properties

DateOfBirth

• DateOfBirth: string


Email

• Email: string


FirstName

• FirstName: string


Gender

• Gender: string


LastName

• LastName: string


RoleID

• RoleID: string

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgDeletePartnerMeasurements200Response

Interface: OrgDeletePartnerMeasurements200Response

Properties

status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgDeleteSelfMeasurements200Response

Interface: OrgDeleteSelfMeasurements200Response

Properties

status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgDeleteUser

Interface: OrgDeleteUser

Organization delete user

Properties

success

• success: boolean

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgDeleteUser200Response

Interface: OrgDeleteUser200Response

Properties

body

• body: OrgDeleteUser

Organization delete user response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgListProfileRequest

Interface: OrgListProfileRequest

Properties

created

• created: null | string

filter by creation date.


limit

• limit: null | string

default limit: 25


offset

• offset: null | string

default offset: 0


ownerUser

• ownerUser: null | string

Profile owner's email to filter by. Example: john@doe.com.


statusId

• statusId: null | string

filter by profile StatusID.


userProfileName

• userProfileName: null | string

Profile's name to filter by. Example: john@doe.com

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgListProfiles200Response

Interface: OrgListProfiles200Response

Properties

body

• body: OrgProfile[]

Organization list profiles


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgLogin

Interface: OrgLogin

Properties

RefreshToken

• RefreshToken: string


Token

• Token: string

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgLogin200Response

Interface: OrgLogin200Response

Properties

body

• body: OrgLogin

Organization login response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgLoginRequest

Interface: OrgLoginRequest

Properties

Email

• Email: string


Identifier

• Identifier: string


MFAToken

• MFAToken: number


Password

• Password: string

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgLogo

Properties

data

• data: string

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgLogo200Response

Interface: OrgLogo200Response

Properties

body

• body: OrgLogo

Organization logo


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgMeasurementInfo

Interface: OrgMeasurementInfo

Organization measurement info

Properties

City

• City: string


Comments

• Comments: Object


Country

• Country: string


Created

• Created: number


DataSizeBytes

• DataSizeBytes: number


DeviceID

• DeviceID: string


DeviceVersion

• DeviceVersion: null | string


ID

• ID: string


Mode

• Mode: string


OrganizationID

• OrganizationID: string


PartnerID

• PartnerID: null | string


Region

• Region: string


Resolution

• Resolution: number


Results

• Results: Object


SignalConfig

• SignalConfig: Object


SignalDescriptions

• SignalDescriptions: Object


SignalNames

• SignalNames: Object


SignalUnits

• SignalUnits: Object


State

• State: string


StatusID

• StatusID: string


StudyID

• StudyID: string


Updated

• Updated: number


UserID

• UserID: string


UserProfileID

• UserProfileID: null | string

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgMeasurementsRequest

Interface: OrgMeasurementsRequest

Properties

date

• date: null | string

The date to return measurements for yyyy-mm-dd.


endDate

• endDate: null | string

End date for range of measurements to receive.


limit

• limit: null | string

default limit: 50


offset

• offset: null | string

default offset: 0


statusId

• statusId: null | string

filter by measurement Status ID.


studyID

• studyID: null | string

filter by studyID


userName

• userName: null | string

filter by user email.


userProfileID

• userProfileID: null | string

filter by a Profile ID.


userProfileName

• userProfileName: null | string

filter by a Profile name

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgProfile

Interface: OrgProfile

Organization profile

Properties

Created

• Created: number


Email

• Email: string


ID

• ID: string


MeasurementCount

• MeasurementCount: string


Name

• Name: string


OwnerUser

• OwnerUser: null | string


Status

• Status: string


TotalCount

• TotalCount: number


Updated

• Updated: number

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgRegisteredLicense

Interface: OrgRegisteredLicense

Organization registered license

Properties

DeviceID

• DeviceID: string


RefreshToken

• RefreshToken: string


RoleID

• RoleID: string

Role associated with your License


Token

• Token: string


UserID

• UserID: string

User account associated with your License

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgRegisterLicense200Response

Interface: OrgRegisterLicense200Response

Properties

body

• body: OrgRegisteredLicense

Organization register license response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgRegisterLicenseRequest

Interface: OrgRegisterLicenseRequest

Status response

Properties

DeviceTypeID

• DeviceTypeID: "IPHONE" | "IPAD" | "DARWIN" | "ANDROID_PHONE" | "WINDOWS" | "WIN32" | "WINDOWS_TABLET" | "LINUX" | "DEBIAN"

IPHONE = All iPhone devices

IPAD = All generations of iPad devices

DARWIN = Desktop MacOS based systems

ANDROID_PHONE = All Android based phone devices

WINDOWS = Desktop Windows64 based systems

WIN32 = Desktop Windows32 based systems

WINDOWS_TABLET = Windows-based tablet devices

LINUX = Linux based devices

DEBIAN = Debian based devices


Identifier

• Identifier: string


Key

• Key: string

License key


Name

• Name: string


TokenExpiresIn

• Optional TokenExpiresIn: number


TokenSubject

• Optional TokenSubject: string


Version

• Version: string

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgRetrieveInformation

Interface: OrgRetrieveInformation

Organization retrieve information

Properties

AdminPasswordMinLength

• AdminPasswordMinLength: number


Contact

• Contact: string


Created

• Created: number


Email

• Email: string


ID

• ID: string


Identifier

• Identifier: string


LivenessConfig

• LivenessConfig: Object

Type declaration

NameType
FakeDetectionboolean
SNRThresholdingboolean
VisageLivenessboolean

Name

• Name: string


OrgAddresses

• OrgAddresses: any[]


PasswordMinLength

• PasswordMinLength: number


PasswordRequireCharacterClasses

• PasswordRequireCharacterClasses: number


PasswordRequireDigits

• PasswordRequireDigits: boolean


PasswordRequireLowercase

• PasswordRequireLowercase: boolean


PasswordRequireSpecial

• PasswordRequireSpecial: boolean


PasswordRequireUppercase

• PasswordRequireUppercase: boolean


PasswordRotateDays

• PasswordRotateDays: number


RequireUniquePasswordsCount

• RequireUniquePasswordsCount: number


SessionIdleDurationSeconds

• SessionIdleDurationSeconds: number


SessionMaxDurationSeconds

• SessionMaxDurationSeconds: number


StatusID

• StatusID: string


Updated

• Updated: number

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgRetrieveInformation200Response

Interface: OrgRetrieveInformation200Response

Properties

body

• body: OrgRetrieveInformation

Organization retrieve information response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgRetrieveMeasurement200Response

Interface: OrgRetrieveMeasurement200Response

Properties

body

• body: OrgMeasurementInfo

Organization retrieve measurement info response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgRetrieveProfile200Response

Interface: OrgRetrieveProfile200Response

Properties

body

• body: OrgUserProfile

Organization retrieve user profile


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgRetrieveUser200Response

Interface: OrgRetrieveUser200Response

Properties

body

• body: OrgUser

Organization retrieve user


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgCreOrgUnregisterLicense200ResponseateUser

Interface: OrgUnregisterLicense200Response

Properties

status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgUpdateProfile200Response

Interface: OrgUpdateProfile200Response

Properties

status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgUpdateProfileRequest

Interface: OrgUpdateProfileRequest

Properties

Email

• Email: string


Name

• Name: string


Status

• Status: string

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgUpdateUser

Interface: OrgUpdateUser

Organization update user

Properties

success

• success: boolean

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgUpdateUser200Response

Interface: OrgUpdateUser200Response

Properties

body

• body: OrgUpdateUser

Organization update user response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgUpdateUserRequest

Interface: OrgUpdateUserRequest

Properties

DateOfBirth

• DateOfBirth: string


FirstName

• FirstName: string


Gender

• Gender: string


HeightCm

• HeightCm: string


LastName

• LastName: string


WeightKg

• WeightKg: string

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgUser

Interface: OrgUser

Organization user

Properties

AvatarURI

• AvatarURI: null | string


Created

• Created: number


DateOfBirth

• DateOfBirth: null | string


DeviceID

• DeviceID: string


Email

• Email: string


FirstName

• FirstName: null | string


Gender

• Gender: string


HeightCm

• HeightCm: null | number


ID

• ID: string


IsVerified

• IsVerified: boolean


LastName

• LastName: null | string


LoginMethod

• LoginMethod: string


OrganizationID

• OrganizationID: string


Password

• Password: string


PhoneNumber

• PhoneNumber: null | string


Region

• Region: string


ResetToken

• ResetToken: null | string


ResetTokenDate

• ResetTokenDate: null | string


RoleID

• RoleID: string


SSOID

• SSOID: null | string


StatusID

• StatusID: string


Updated

• Updated: number


VerificationCode

• VerificationCode: string


WeightKg

• WeightKg: null | number

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgUserProfile

Interface: OrgUserProfile

Organization user profile

Properties

Created

• Created: number


Email

• Email: string


ID

• ID: string


MeasurementCount

• MeasurementCount: number


Name

• Name: string


Status

• Status: string


Updated

• Updated: number

@nuralogix.ai/dfx-api-client / HTTP / Organizations / Interfaces / OrgUsersRequest

Interface: OrgUsersRequest

Properties

date

• date: null | string

Account creation start date in the format YYYY-MM-DD


endDate

• endDate: null | string

Account creation end date in the format YYYY-MM-DD.


gender

• gender: null | string

filter by user's gender.


limit

• limit: null | string

default limit: 25


offset

• offset: null | string

default offset: 0


roleId

• roleId: null | string

filter by user's Role.


statusId

• statusId: null | string

filter by user's Status.


userName

• userName: null | string

filter by user's email

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

Studies

Studies end points

Studies are organized segments of analyses that guide the measurement process. Studies consist of Types, Templates and Assets. A study type is a general, high-level grouping for studies. A template is a pre-built study standard created and made available by the Nuralogix team. Templates are version controlled and named for use with a study.

Sample code

const apiClient = client();
const response = await apiClient.http.studies.retrieve('your-study-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 StudyRetrieve200Response */
console.log(body.Name);

Methods

create

▸ create(data)

Creates a new study within an organization. Studies must be based on a specific StudyTemplateID. Passing in config will override values available in the StudyType definition template.

Endpoint Action ID = 80x

Parameters

NameType
dataStudyCreateRequest

Returns

Promise<ErrorResponse | StudyCreate200Response>


deleteStudyMeasurement

▸ deleteStudyMeasurement(studyId)

Only DFX_ORG_ADMIN has permission to delete all measuremenet of specific study for its own organization.

Endpoint Action ID = 811

Parameters

NameType
studyIdstring

Returns

Promise<ErrorResponse | StudyDeleteMeasurements200Response>


list

▸ list(statusId)

Lists all the studies created in an organization.

Endpoint Action ID = 805

Parameters

NameType
statusIdnull | string

Returns

Promise<ErrorResponse | StudyList200Response>


remove

▸ remove(studyId)

Deletes a study. However, if there are any measurements taken under that Study already, it cannot be deleted.

Endpoint Action ID = 808

Parameters

NameType
studyIdstring

Returns

Promise<ErrorResponse | StudyDelete200Response>


retrieve

▸ retrieve(studyId)

Retrieves a study record with it's definitions and values. It also displays the amount of measurements captured in it to date.

Endpoint Action ID = 804

Parameters

NameType
studyIdstring

Returns

Promise<ErrorResponse | StudyRetrieve200Response>


retrieveSdkConfigData

▸ retrieveSdkConfigData(data)

Retrieves a study's binary config data that has to be used to initialize the DFX SDK Factory object. Get the SDKID parameter by calling GetSDKId on the DFX SDK Factory object. A response of 304 means that existing file in hand is up to date.

Endpoint Action ID = 806

Parameters

NameType
dataStudyRetrieveSdkConfigDataRequest

Returns

Promise<ErrorResponse | StudySdkConfigData200Response>


templates

▸ templates(data)

Retrieves a list of study templates that exist in a particular organization.

Endpoint Action ID = 801

Parameters

NameType
dataStudyTemplateRequest

Returns

Promise<ErrorResponse | StudyTemplates200Response>


types

▸ types(statusId)

Retrieves a list of studies that act as templates or base types. Types can be filtered by the Status querystring value. This is useful for looking up all studies and current.

Endpoint Action ID = 800

Parameters

NameType
statusIdnull | string

Returns

Promise<ErrorResponse | StudyTypes200Response>


update

▸ update(studyId, data)

Updates a particular study record with new information. Organizations can set the status of a particular study as well to record their general activity and visibility. Study templates cannot be revised after a study is created.

Endpoint Action ID = 807

Parameters

NameType
studyIdstring
dataStudyUpdateRequest

Returns

Promise<ErrorResponse | StudyUpdate200Response>

@nuralogix.ai/dfx-api-client / HTTP / Studies / Interfaces

Interfaces

@nuralogix.ai/dfx-api-client / HTTP / Studies / Interfaces / StudySdkConfigData

Interface: StudySdkConfigData

Study SDK config data

Properties

ConfigFile

• ConfigFile: string


MD5Hash

• MD5Hash: string

@nuralogix.ai/dfx-api-client / HTTP / Studies / Interfaces / Study

Interface: Study

Study

Properties

Created

• Created: number


Description

• Description: string


ID

• ID: string


Measurements

• Measurements: number


Name

• Name: string


Participants

• Participants: number


StatusID

• StatusID: string


StudyTemplateID

• StudyTemplateID: string


TotalCount

• TotalCount: number


Updated

• Updated: number

@nuralogix.ai/dfx-api-client / HTTP / Studies / Interfaces / StudyCreate

Interface: StudyCreate

Study created

Properties

ID

• ID: string

@nuralogix.ai/dfx-api-client / HTTP / Studies / Interfaces / StudyCreate200Response

Interface: StudyCreate200Response

Properties

body

• body: StudyCreate

Study created response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Studies / Interfaces / StudyCreateRequest

Interface: StudyCreateRequest

Study create request

Properties

Config

• Config: Object

Index signature

▪ [x: string]: string


Description

• Description: string


Name

• Name: string


StudyTemplateID

• StudyTemplateID: string

@nuralogix.ai/dfx-api-client / HTTP / Studies / Interfaces / StudyDelete

Interface: StudyDelete

Study deleted

Properties

success

• success: boolean

@nuralogix.ai/dfx-api-client / HTTP / Studies / Interfaces / StudyDelete200Response

Interface: StudyDelete200Response

Properties

body

• body: StudyDelete

Study deleted response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Studies / Interfaces / StudyDeleteMeasurements200Response

Interface: StudyDeleteMeasurements200Response

Properties

status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Studies / Interfaces / StudyList200Response

Interface: StudyList200Response

Properties

body

• body: Study[]

Array of studies


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Studies / Interfaces / StudyRetrieve

Interface: StudyRetrieve

Study retrieve

Properties

Created

• Created: number


Description

• Description: string


ID

• ID: string


Measurements

• Measurements: number


Name

• Name: string


OrganizationID

• OrganizationID: string


Participants

• Participants: number


Signals

• Signals: string[]


StatusID

• StatusID: string


StudyTemplateID

• StudyTemplateID: string


StudyTemplateName

• StudyTemplateName: string


Updated

• Updated: number

@nuralogix.ai/dfx-api-client / HTTP / Studies / Interfaces / StudyRetrieve200Response

Interface: StudyRetrieve200Response

Properties

body

• body: StudyRetrieve

Study retrieve response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Studies / Interfaces / StudyRetrieveSdkConfigDataRequest

Interface: StudyRetrieveSdkConfigDataRequest

Study RetrieveSdkConfigData request

Properties

MD5Hash

• Optional MD5Hash: string


SDKID

• Optional SDKID: string


StudyID

• StudyID: string

@nuralogix.ai/dfx-api-client / HTTP / Studies / Interfaces / StudySdkConfigData200Response

Interface: StudySdkConfigData200Response

Properties

body

• body: StudySdkConfigData

Study SDK config data


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Studies / Interfaces / StudyTemplate

Interface: StudyTemplate

Study template

Properties

BundleID

• BundleID: null | string


Config

• Config: Object


Created

• Created: number


Description

• Description: string


ID

• ID: string


Name

• Name: string


Signals

• Signals: string[]


StatusID

• StatusID: string


StudyTypeID

• StudyTypeID: string

@nuralogix.ai/dfx-api-client / HTTP / Studies / Interfaces / StudyTemplateRequest

Interface: StudyTemplateRequest

Study Template request

Properties

status

• status: string


type

• type: string

@nuralogix.ai/dfx-api-client / HTTP / Studies / Interfaces / StudyTemplates200Response

Interface: StudyTemplates200Response

Properties

body

• body: StudyTemplate[]

Study templates response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Studies / Interfaces / StudyType

Interface: StudyType

Study Type

Properties

Description

• Description: string


ID

• ID: string


Name

• Name: string


StatusID

• StatusID: string

@nuralogix.ai/dfx-api-client / HTTP / Studies / Interfaces / StudyTypes200Response

Interface: StudyTypes200Response

Properties

body

• body: StudyType[]

Study Types response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Studies / Interfaces / StudyUpdate

Interface: StudyUpdate

Study updated

Properties

success

• success: boolean

@nuralogix.ai/dfx-api-client / HTTP / Studies / Interfaces / StudyUpdate200Response

Interface: StudyUpdate200Response

Properties

body

• body: StudyUpdate

Study updated response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Studies / Interfaces / StudyUpdateRequest

Interface: StudyUpdateRequest

Study update request

Properties

Config

• Config: Object

Index signature

▪ [x: string]: string


Description

• Description: string


Name

• Name: string


StatusID

• StatusID: string

@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>

@nuralogix.ai/dfx-api-client / http / Devices / Interfaces

Interfaces

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

Interface: DeviceCreated

Device created

Properties

ID

• ID: string

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

Interface: DeviceCreated200Response

Properties

body

• body: DeviceCreated

Device created response


status

• status: "200"

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

Interface: DeviceCreateRequest

Device create request

Properties

DeviceTypeID

• DeviceTypeID: "IPHONE" | "IPAD" | "DARWIN" | "ANDROID_PHONE" | "WINDOWS" | "WIN32" | "WINDOWS_TABLET" | "LINUX" | "DEBIAN"


Identifier

• Identifier: string


Name

• Name: string


Version

• Version: string

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

Interface: DeviceDeleted200Response

Properties

status

• status: "200"

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

Interface: DeviceDeleteMeasurements200Response

Properties

status

• status: "200"

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

Interface: DeviceLicense

Device license

Properties

Expiration

• Expiration: number


ID

• ID: string


LicenseType

• LicenseType: string


MaxDevices

• MaxDevices: number


StatusID

• StatusID: string

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

Interface: DeviceList200Response

Properties

body

• body: Device[]

List of existing devices in an organization


status

• status: "200"

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

Interface: DeviceListRequest

Device list request

Properties

date

• date: null | string


deviceTypeID

• deviceTypeID: null | "IPHONE" | "IPAD" | "DARWIN" | "ANDROID_PHONE" | "WINDOWS" | "WIN32" | "WINDOWS_TABLET" | "LINUX" | "DEBIAN"


endDate

• endDate: null | string


limit

• limit: null | string


name

• name: null | string


offset

• offset: null | string


statusId

• statusId: null | string


unique

• unique: null | string


version

• version: null | string

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

Interface: DeviceRetrieve

Device retrieve

Properties

Created

• Created: number


DeviceTypeID

• DeviceTypeID: "IPHONE" | "IPAD" | "DARWIN" | "ANDROID_PHONE" | "WINDOWS" | "WIN32" | "WINDOWS_TABLET" | "LINUX" | "DEBIAN"


Identifier

• Identifier: string


Name

• Name: string


Region

• Region: string


StatusID

• StatusID: string


Updated

• Updated: number


Version

• Version: string


count

• count: string

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

Interface: DeviceRetrieve200Response

Properties

body

• body: DeviceRetrieve

Device retrieve response


status

• status: "200"

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

Interface: DeviceRetrieveLicenseId200Response

Properties

body

• body: DeviceLicense

Device retrieve license ID response


status

• status: "200"

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

Interface: DeviceType

Device type

Properties

Description

• Description: string


ID

• ID: string


IsDesktop

• IsDesktop: boolean


IsMobile

• IsMobile: boolean


IsTablet

• IsTablet: boolean


Name

• Name: string

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

Interface: DeviceTypes200Response

Properties

body

• body: DeviceType[]

Device type response


status

• status: "200"

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

Interface: DeviceUpdated200Response

Properties

status

• status: "200"

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

Interface: DeviceUpdateRequest

Device update request

Properties

DeviceTypeID

• DeviceTypeID: "IPHONE" | "IPAD" | "DARWIN" | "ANDROID_PHONE" | "WINDOWS" | "WIN32" | "WINDOWS_TABLET" | "LINUX" | "DEBIAN"


Identifier

• Identifier: string


Name

• Name: string


Status

• Status: string


Version

• Version: string

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

Interface: Device

Properties

Created

• Created: number


DeviceTypeID

• DeviceTypeID: "IPHONE" | "IPAD" | "DARWIN" | "ANDROID_PHONE" | "WINDOWS" | "WIN32" | "WINDOWS_TABLET" | "LINUX" | "DEBIAN"


ID

• ID: string


Identifier

• Identifier: string


LicenseID

• LicenseID: string


Measurements

• Measurements: number


Name

• Name: string


Region

• Region: string


StatusID

• StatusID: string


TotalCount

• TotalCount: number


Updated

• Updated: number


Version

• Version: string

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

Licenses

Licenses end points

These endpoints allow to list Licenses available to your User/Organization.

Sample code

const apiClient = client();
const response = await apiClient.http.licenses.listOrgLicenses();
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 LicensesList200Response */
console.log(body.MaxDevices);

Methods

listOrgLicenses

▸ listOrgLicenses()

List licenses available to your User/Organization.

Endpoint Action ID = 1406

Returns

Promise<ErrorResponse | LicensesList200Response>

@nuralogix.ai/dfx-api-client / HTTP / Licenses / Interfaces

Interfaces

@nuralogix.ai/dfx-api-client / HTTP / Licenses / Interfaces / License

Interface: License

License

Properties

Created

• Created: number


DeviceRegistrations

• DeviceRegistrations: number


Expiration

• Expiration: number


ID

• ID: string


Key

• Key: string


LicenseType

• LicenseType: string


MaxDevices

• MaxDevices: number


StatusID

• StatusID: string


TotalCount

• TotalCount: number

@nuralogix.ai/dfx-api-client / HTTP / Licenses / Interfaces / LicensesList200Response

Interface: LicensesList200Response

Properties

body

• body: License[]

List of available licenses response


status

• status: "200"

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

Auths

Auths end points

These endpoints provide user/device authentication.

Sample code

const apiClient = client();
const data = {
    Token: 'your-old-token'
    RefreshToken: 'your-old-refresh-token'
};

const response = await apiClient.http.auths.renew(data);
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 RenewToken200Response */
console.log(body.RefreshToken);

Methods

renew

▸ renew(data)

Renew user/device access and refresh token. When you register a license or login with user's credentials, a pair of Token and RefreshToken is sent to a client. The client needs to send the matching pair to exchange it with a new pair. The old pair will not be valid after calling this endpoint. RefreshToken is one-time use.

Endpoint Action ID = 2304

Parameters

NameType
dataAuthRenewTokenRequest

Returns

Promise<ErrorResponse | AuthRenewToken200Response>


requestLoginCode

▸ requestLoginCode(data)

Request to send login code.

Endpoint Action ID = 2303

Parameters

NameType
dataAuthLoginCodeRequest

Returns

Promise<ErrorResponse | AuthLoginCodeSent200Response>


requestResetPasswordLink

▸ requestResetPasswordLink(data)

Request to send password reset link to user's email.

Endpoint Action ID = 2300

Parameters

NameType
dataAuthResetPasswordLinkRequest

Returns

Promise<ErrorResponse | AuthResetPasswordLink200Response>

@nuralogix.ai/dfx-api-client / HTTP / Auths / Interfaces

Interfaces

@nuralogix.ai/dfx-api-client / HTTP / Auths / Interfaces / AuthLoginCodeRequest

Interface: AuthLoginCodeRequest

Login code request

Properties

Identifier

• Identifier: string

organization identifier


PhoneNumber

• PhoneNumber: string

@nuralogix.ai/dfx-api-client / HTTP / Auths / Interfaces / AuthLoginCodeSent

Interface: AuthLoginCodeSent

Login code sent

Properties

success

• success: boolean

@nuralogix.ai/dfx-api-client / HTTP / Auths / Interfaces / AuthLoginCodeSent200Response

Interface: AuthLoginCodeSent200Response

Properties

body

• body: AuthLoginCodeSent

Login code sent response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Auths / Interfaces / AuthRenewToken

Interface: AuthRenewToken

Renew token

Properties

RefreshToken

• RefreshToken: string


Token

• Token: string

@nuralogix.ai/dfx-api-client / HTTP / Auths / Interfaces / AuthRenewToken200Response

Interface: AuthRenewToken200Response

Properties

body

• body: AuthRenewToken

Renew token response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Auths / Interfaces / AuthRenewTokenRequest

Interface: AuthRenewTokenRequest

Renew token request

Properties

RefreshToken

• RefreshToken: string


Token

• Token: string

@nuralogix.ai/dfx-api-client / HTTP / Auths / Interfaces / AuthResetPasswordLink

Interface: AuthResetPasswordLink

Reset password link

Properties

success

• success: boolean

@nuralogix.ai/dfx-api-client / HTTP / Auths / Interfaces / AuthResetPasswordLink200Response

Interface: AuthResetPasswordLink200Response

Properties

body

• body: AuthResetPasswordLink

Reset password link response


status

• status: "200"

@nuralogix.ai/dfx-api-client / HTTP / Auths / Interfaces / AuthResetPasswordLinkRequest

Interface: AuthResetPasswordLinkRequest

Reset password link request

Properties

Email

• Email: string


Identifier

• Identifier: string

Organization identifier

@nuralogix.ai/dfx-api-client / WebSocket

WebSocket

The WebSocket API is an advanced technology that makes it possible to open a two-way interactive communication session between the user's browser and a server. With this API, you can send messages to a server and receive event-driven responses without having to poll the server for a reply.

@nuralogix.ai/dfx-api-client / WebSocket / events

There are three WebSocket events:

  • onmessage
  • onclose
  • onerror

onmessage

onmessage is emitted when a new response is sent from the server to the client. You can have your custom logic based on each actionId you are receiving as part of the response.

const apiClient = client();
apiClient.websocket.onmessage = (requestId: string, status: string, message: any, actionId: string) => {
  // When socket connection is opened, the library tries to
  // authenticate against server using the `apiClient.session.deviceToken`
  // property that is previously stored in the current instance of the apiClient.
  // When authenticated, a reponse with a '0718' actionId will be returned from the server.
  // Once received, you can subscribe to measurement results by sending a '0510' actionId.
  if (actionId === '0718') {
    apiClient.websocket.sendMessage(
      '0510',
      { Params: {ID: 'your-measurement-id-goes-here' }, RequestID: '' }
    );
  }
  // A '0510' actionId will be returned from the server when
  // are subscribed to measurement results.
  if (actionId === '0510') {
    if (Object.keys(message).length === 0) {
      // If you received an empty message then it means your
      // successfully subscribed to the measurement results.
      // here you can have your logic to start your measurement
    } else {
      // Otherwise, the measurement is already started and the
      // message contains measurement results. You can process/display results.
    }
  }
  // A 0506 actionId is emitted on each chunk number
  if (actionId === '0506') {
    console.log('ChunkOrder', message.ChunkOrder)
  }
}

onclose

onclose CloseEvent is emitted when the connection is closed.

const apiClient = client();
apiClient.websocket.onclose = (e: CloseEvent) => {
    console.log('connection closed!', e.code, e.reason, e.wasClean);
}

onerror

onerror Event is emitted when there is an error.

const apiClient = client();
apiClient.websocket.onerror = (e: Event) => {
    console.log('error', e);
}

@nuralogix.ai/dfx-api-client / WebSocket / methods

Methods

There are three WebSocket methods:

  • connect
  • disconnect
  • sendMessage

connect

To establish a new WebSocket connection:

const apiClient = client();
apiClient.websocket.connect();

NOTE: When socket connection is opened, the library tries to authenticate against server using the apiClient.session.deviceToken property that is previously stored in the current instance of the apiClient.

Please make sure the token is already set for the current session before staring a connection.

disconnect

To close the current connection:

apiClient.websocket.disconnect();

sendMessage

To send a message to the server:

apiClient.websocket.sendMessage(actionId: string, data: any);

Example:

/**
 * Adds collected blood-flow data to a specific measurement. Upon submitting a
 * chunk of data, the API will return a MeasurementDataID value representing
 * the received chunk. Data must be sent to the server in the order produced by
 * the DFX SDK. If a chunk it sent out of order, the server will return an error.
 * Please ensure that new chunks are only sent after the server responds with a
 * MeasurementDataID.
 * 
 * Submitting measurements has three stages:
 * 
 * a) starting,
 * 
 * b) measurement body,
 * 
 * c) closing a measurement.
 * 
 * Each of these phases have the same payload structure however a different Action
 * flag is to be sent with each request and must follow the CHUNK::ACTION format.
 * 
 * Measurement Actions | Description
 * 
 * FIRST::PROCESS      | Start a new measurement (drop any existing), Process results
 * 
 * FIRST::IGNORE       | Start a new measurement (drop any existing), Do not process
 * 
 * CHUNK::PROCESS      | Arbitrary block of TOI data and process results
 * 
 * CHUNK::IGNORE       | Arbitrary block of TOI data and do not process results
 * 
 * LAST::PROCESS       | Finish a measurement cycle and process results
 * 
 * LAST::IGNORE        | Finish a measurement cycle and do not process
 * 
 * `Payload` is binary data that can currently only be obtained by using our SDK.
 * The Payload (binary content) field must be `base64-encoded`.
 * 
 * Note: This endpoint is a subject to request throttling, you must not submit more
 * data than can be obtained in real time. i.e., do not send more than five seconds
 * of chunk data over the course of five seconds of real time.
 * 
 * Response Error Codes Explanation:
 * 
 * * "RATE_LIMIT": You have sent too many chunks in a given time period. See the Note above.
 * * "MEASUREMENT_CLOSED": Requested Measurement is already finished. You need to create a new Measurement.
 * * "MISALIGNED_CHUNK": Chunk Order was mismatched. i.e., ChunkOrder 2 was sent before ChunkOrder 1.
 * * "INVALID_MEASUREMENT": Requested Measurement ID was not found.
 * * "UNPACKER_RPC_ERROR": Payload validation has been failed. Reason(s) will be provided in error message.
 */
apiClient.websocket.sendMessage(
  '0506',
  {
    Params: {ID: 'your-measurement-id-goes-here' }, 
    Action: 'set-action-here',
    Payload: Buffer.from('your-payload').toString('base64')
  }
);

Note: the same actionId you set here is returned when the response of your call is received from the server in onmessage event

@nuralogix.ai/dfx-api-client / Interfaces

Interfaces

@nuralogix.ai/dfx-api-client / Interfaces / ISession

Interface: ISession

Session

Properties

deviceId

• Optional deviceId: string


deviceRefreshToken

• Optional deviceRefreshToken: string


deviceToken

• Optional deviceToken: string


lastMeasurementId

• Optional lastMeasurementId: string


roleId

• Optional roleId: string


selectedStudy

• Optional selectedStudy: string


studyCfgData

• Optional studyCfgData: string


studyCfgHash

• Optional studyCfgHash: string


userId

• Optional userId: string


userRefreshToken

• Optional userRefreshToken: string


userToken

• Optional userToken: string

@nuralogix.ai/dfx-api-client / Interfaces / IUrl

Interface: IUrl

Properties

http

• http: URL


wss

• wss: URL

@nuralogix.ai/dfx-api-client / Interfaces / ErrorResponse

Interface: ErrorResponse

Properties

body

• body: Object

Type declaration

NameType
errorCodestring
messagestring

status

• status: "400" | "404" | "500"