Best Practices

DeepAffex License Registration and Token Validation

  1. Use the provided DeepAffex license key to register the license by calling the Organizations.RegisterLicense endpoint. A pair of tokens (a Device Token and a One-Time Refresh Token) is returned. To learn more about tokens, please refer to the authentication chapter in our developer guide.

  2. Store tokens safely in the device's secure storage. Tokens must be used for any subsequent DeepAffex API calls.

  3. To ensure that a token is valid before making a DeepAffex Cloud API call, you can call the General.VerifyToken endpoint which returns the token's status.

  4. Your application should call Auths.Renew endpoint if the Device Token has expired. If the Refresh Token has also expired or was not available, your application may need to call the Organizations.RegisterLicense endpoint again to obtain a fresh pair of Device and Refresh Tokens

Note

If the ActiveLicense field in the General.VerifyToken response is false, please contact NuraLogix to renew your DeepAffex license. Your application is responsible to handle this failure case gracefully.

Measurement Questionnaire and User Demographics

  1. Upon your app's initial launch, prompt the user to complete the measurement questionnaire. For further details on questionnaires, please refer to the Measurement Questionnaire Section in our developer's guide. This information will enhance the accuracy of future measurements, some of which will depend on these data.

Taking Measurements

  1. Your application needs to request camera permission before taking measurements. Anura Core SDK will not work without access to the camera, and your application needs to handle the case when the user denies the camera permission.

  2. You can customize the look and feel of the measurement UI though MeasurementUIConfiguration. To learn more on how to customize the measurement UI, please refer to Measurement UI Customization iOS and Measurement UI Customization Android.

  3. To obtain measurement results in real-time, your application can set up a WebSocket connection and use the Measurements.SubscribeResults endpoint. After the measurement is complete and all results are received, your app may disconnect the WebSocket connection.

  4. Before your app can start sending measurement payloads to obtain results, it must first create a measurement using the Measurement.Create endpoint. The endpoint will return a measurement ID, which is used to refer to the measurement in subsequent API calls.

  5. After the measurement starts, each extracted payload needs to be sent to DeepAffex Cloud in sequence. For information about this interface, please refer to the Measurement.AddData endpoint.

  6. If your application is subscribed to results over WebSocket, the results can be obtained from the MeasurementResults object. Your application can then display these results on the measurement screen (e.g. heart rate), and on a separate results screen after the measurement is complete. For more information on how to interpret the results, please refer to the DFX Points Reference.

  7. With Anura Core SDK, you must always take measurements in anonymous mode using Partner ID. Please do not use Users and Profiles related API Endpoints.