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