Authentication (Iara API)
All SDK features rely on authenticating with the Iara API. To perform authentication, you need the following:
- An
apiToken
for your application; - One or more
userId
(one for each user of your application).
Tip: don't have auserId
andapiToken
yet? Write to contato@iarahealth.com to get your Iara API credentials.
The apiToken
value is the access code that your application earns to use the Iara Health services. Generally this value is a 32 characters hash. You need a single apiToken
per application.
However, the value of userId
is used to identify each user of your application. As the Iara voice recognition is customized by user, each user must have its own userId
. The value of userId
identifies only a person and is used to download and adjust of an own voice model to the user in question.
IMPORTANT: different users must not use the same userId
. If it happens, the voice recognition accuracy will be degraded.
Authentication during boot
Iara Health recognizer initialization requires an authentication. The authentication is done through the mandatory userId
and apiToken
properties passed to the method init()
:
var recognition = new IaraSpeechRecognition();
recognition.init({
userId: 'meu@email.com',
apiToken: '197765800edb8affcb44a7ae7b4ff0a3'
}).done(function(e) {
// All right, recognition can begin.
}).fail(function(e) {
// Some problem happened.
});
The example userId-apiToken-test
contains ready codes referring to authentication. Besides this, see the section Initialization to learn more about the recognizer initialization.