Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
This method is to generate a Cortex access token. Most of the methods of the Cortex API require this token as a parameter.
Application can specify the license key and the amount of sessions to be debited from the license and use them locally.
The token is linked to your application. It cannot be used with another application. The token is also linked to the EmotivID of the current user. It cannot be used with another EmotivID. So if the user logs out in EMOTIV Launcher, and then logs in with another EmotivID, your application must call this API again to get a new token.
Your application can save the Cortex token and reuse it later, within 2 days. Note that it is the responsibility of the application to secure the token.
If the user has not accepted the EULA, then a warning message will be included in the response as well. The user must accept the EULA through EMOTIV Launcher.
Before you call this method, the user must approve your application in EMOTIV Launcher. See requestAccess for details.
The Cortex token must remain secret. Do NOT share it. It is your responsibility to keep it secure.
The result is an object containing a field cortexToken. It may also include a field warning, if the user didn't accept the EULA.
Name
Type
Required
Description
clientId
string
yes
The client id of your Cortex application.
clientSecret
string
yes
The client secret of your Cortex application.
license
string
no
A license id. In most cases, you don't need to specify the license id. Cortex will find the appropriate license based on the client id.
debit
number
no
Number of sessions to debit from the license, so that it can be spent locally without having to authorize again. You need to debit the license only if you want to activate a session. The default value is zero.
Name
Type
Description
cortexToken
string
The Cortex token of the user
warning
object
Contains a message and the URL to accept the EULA
After your application is successfully connected to the Cortex service, you must go through the authentication procedure.
First, you should call getUserLogin to check if the user has already logged in though EMOTIV Launcher. Then, you must call requestAccess to ask the user to approve your application.
Finally, call authorize to generate a Cortex token or you can reuse a token that you previously got from this method, if it is not expired.
Request user approval for the current application through EMOTIV Launcher.
When your application calls this method for the first time, EMOTIV Launcher displays a message to approve your application. You can call this API many times, but EMOTIV Launcher will prompt the user only once. If the user has already approved your application, then this API does nothing.
Almost all the methods of the API require that your application was approved in EMOTIV Launcher. These methods will return an error if your application wasn't approved.
Any application that connects to Cortex must call this API to request approval from the user through EMOTIV Launcher.
Most of the methods of the API will fail if the user didn't approve your application.
The result is an object containing a boolean value "accessGranted" and a message.
If accessGranted is false, then your application should ask the user to check EMOTIV Launcher and approve your application. Then you should wait for a while and call this API again. If accessGranted is true, then no action is required.
Check if your application has been granted access rights or not in EMOTIV Launcher.
Any application that connects to Cortex must request approval from the user through EMOTIV Launcher. See requestAccess for details.
The result is an object containing a boolean value "accessGranted" and a message.
If accessGranted is false, then your application should call requestAccess If accessGranted is true, then no action is required
Get the current logged in user.
There is no login or logout API in Cortex. Instead, users are required to login through the EMOTIV Launcher.
This method has no parameter.
The result is an array of objects, each object describes a logged in user. If no user is logged in, then the result is an empty array.
Please note that currently, Cortex is a single user system. Only one user can login at a time, so the result contains at most one object.
The user object includes these fields:
If currentOSUId is equal to loggedInOSUId, then the user is already logged in and can work with Cortex. If currentOSUId is different from loggedInOSUId, then a user is logged into Cortex, but from a different OS account. So the user of the current OS account cannot work with Cortex, and must check EMOTIV Launcher.
The application is connected to Cortex that belongs to the OS account 501/jsnow
. But someone has already logged in to Cortex from OS account 502/astark
with the EmotivID aria.stark
. So, the application cannot work with Cortex.
This method uses a Cortex token to generate a new Cortex token. You can use this method to extend the expiration date of a token.
See authorize for details.
The result is an object containing a field cortexToken.
Name
Type
Required
Description
clientId
string
yes
The client id of your Cortex application
clientSecret
string
yes
The client secret of your Cortex application
Name
Type
Description
accessGranted
boolean
True, if the user has already approved your application False, if the user declined your application, or didn't approve it yet
message
string
Name
Type
Required
Description
cortexToken
string
yes
A token returned by authorize
Name
Type
Description
license
object
An object containing all the information about the current license
isOnline
boolean
True, if Cortex was able to get the license information from the EMOTIV cloud
False, if Cortex got the license information for its local cache
Name
Type
Required
Description
clientId
string
yes
The client id of your Cortex application
clientSecret
string
yes
The client secret of your Cortex application
Name
Type
Description
accessGranted
boolean
True, if the user has already approved your application False, if the user declined your application, or didn't approve it yet
message
string
Name
Type
Required
Description
cortexToken
string
yes
A token returned by authorize
Name
Type
Description
username
string
The EmotivID of the user
firstName
string
The first name of the user
lastName
string
The last name of the user
licenseAgreement
object
An object that contain information about the EULA agreement
Name
Type
Description
username
string
The EmotivID of the user
currentOSUId
string
The id of the current OS account
currentOSUsername
string
The user name for currentOSUId
loggedInOSUId
string
The id of the OS account used to login in EMOTIV Launcher
loggedInOSUsername
string
The user name for loggedInOSUId
lastLoginTime
string (ISO datetime)
When this user logged in for the last time.
This field was added in Cortex 2.3.0
Name
Type
Description
buildDate
string (date time)
The date and time the Cortex binary was built
buildNumber
string
The internal build number
version
string
The version of Cortex. It should have the format "2.y.z"
Name
Type
Required
Description
cortexToken
string
yes
A token returned by authorize
clientId
string
yes
The client id of your Cortex application
clientSecret
string
yes
The client secret of your Cortex application
Name
Type
Description
cortexToken
string
The new Cortex token of the user