Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
A subject represents a human being who is the subject of a record, ie the person wearing the headset during the record. A subject is a permanent object. It is stored on the hard drive and then synchronized to the EMOTIV cloud.
To associate a subject to a record, you must create the subject first, by calling createSubject. Then you must specify the subject name when you call createRecord. A subject is identified by his/her name.
You can call querySubjects to list the subjects already created for the current user.
This method is to update an existing subject.
This method was added in Cortex 2.1
A subject is identified by his/her name, so you must provide the name of the subject you want to update. Then you can set one or more of the not required fields to update their value.
The result is a subject object representing the updated subject.
Update the date of birth of a subject.
This method is to create a new subject. Then you can associate the subject to a record when you call createRecord.
This method was added in Cortex 2.1
The result is a subject object representing the new subject.
Create a subject with only his name.
Create a subject with more information.
This method returns a list of subjects owned by the current user.
This method was added in Cortex 2.1
Depending on the query, this method may return a lot of subjects. To avoid performance issues, you should always set an offset and a limit.
The query object can contain one or more of these fields:
The orderBy parameters is an array of objects, similar to the orderBy clause of a SQL request.
Each object must have a single attribute. The key of the attribute is the name of subject's field you want to order by. The value of the attribute must be "ASC" or "DESC", to order is ascending or descending order.
For example, to order the subjects by their names, in alphabetical order, you must use the object {"subjectName":"ASC"}
.
You can order the subjects by these fields: subjectName, dateOfBirth.
These parameters are to implement pagination. It useful if you want to display the subjects in a UI. You must order the results to use these parameters.
First you should call this method with a offset of zero, and a limit of X. In the response, check the value of count. If count is greater than the limit, then you should call this method again with an offset of X. And then with an offset of 2*X, 3*X... until you get all the subjects for your query.
The result is an object that includes these fields:
Find the 10 first female subjects born in 1979 or 1980.
A subject represents a human being who is the subject of a record (ie an experiment).
A subject object includes these fields:
The field attributes is a list of attributes. A demographic attribute is an object with 2 fields:
You must call getDemographicAttributes to know what are the valid attribute names, and what are the possible values for each attribute.
For example, to tell that the subject is right handed, you can add the attribute { "name":"Handedness", "value":"Right"}
This method is to delete one or more subjects.
Deleting a subject is irreversible. There is no way to recover a deleted subject.
This method was added in Cortex 2.1
A subject is identified by his/her name, so you must provide the name of the subjects you want to delete.
The result is an object that includes these fields:
In case of success, you get an object with these fields:
In case of failure, you get an object with these fields:
.
Name
Type
Required
Description
cortexToken
string
yes
A token returned by authorize.
subjectName
string
yes
The name of the subject.
dateOfBirth
string
no
The date of birth of the subject. The format must be "YYYY-MM-DD", e.g. "1980-12-25".
sex
string
no
Must be "M", "F" or "U". These letters stands for male, female and unknown respectively.
countryCode
string
no
The Alpha-2 ISO code of the country the subject lives in.
state
string
no
The state the subject lives in.
city
string
no
The city the subject lives in.
attributes
array of objects
no
A list of demographic attribute objects. See Subject object.
Name
Type
Required
Description
cortexToken
string
yes
A token returned by authorize.
subjectName
string
yes
The name of the subject. Must be 30 characters or less.
dateOfBirth
string
no
The date of birth of the subject. The format must be "YYYY-MM-DD", e.g. "1980-12-25".
sex
string
no
Must be "M", "F" or "U". These letters stands for male, female and unknown respectively.
countryCode
string
no
The Alpha-2 ISO code of the country the subject lives in.
state
string
no
The state the subject lives in.
city
string
no
The city the subject lives in.
attributes
array of objects
no
A list of demographic attribute objects. See Subject object.
Name
Type
Required
Description
cortexToken
string
yes
A token returned by authorize.
query
object
yes
An object to filter the subjects.
orderBy
array of objects
yes
Specify how to sort the subjects.
limit
number
no
The maximum number of subjects that this method should return. A limit of zero means no maximum.
offset
number
no
The number of subjects that this method should skip before returning the result. If the limit is zero, then Cortex will ignore this parameter.
Name
Type
Description
uuid
string
Set this parameter to get a subject by its id.
subjectName
string
Set this parameter to filter the subjects by name.
sex
string
Set this parameter to filter the subjects by their gender. Must be "M", "F" or "U".
countryCode
string
Set this parameters to filter the subjects by their country.
dateOfBirth
object
An object with fields "from" and "to" to filter the subjects by their date of birth.
keyword
object
An object with the fields as the keyword to search and values are the list of fields to search. The list of fields to search can contains "subjectName", "lastName", "email"
Name
Type
Description
subjects
array of objects
An array of subject objects.
count
number
The total number of subjects that match the query.
limit
number
The limit you specified in the parameters.
offset
number
The offset you specified in the parameters.
Name
Type
Description
subjectName
string
The name of the subject.
dateOfBirth
string
The date of birth of the subject. The format is "YYYY-MM-DD", e.g. "1980-12-25".
sex
string
Can be "M", "F" or "U". These letters stands for male, female and unknown respectively.
experimentsCount
number
countryCode
string
The Alpha-2 ISO code of the country the subject lives in.
countryName
string
The name of the country the subject lives in.
state
string
The state the subject lives in.
city
string
The city the subject lives in.
attributes
array of objects
A list of demographic attribute objects. See below.
Name
Type
Required
Description
name
string
yes
The name of the attribute.
value
string
yes
The value of the attribute.
Name | Type | Description |
subjectName |
| The name of the subject. |
code |
| The error code. |
message |
| The error message. |
Name | Type | Required | Description |
cortexToken |
| yes |
Name | Type | Description |
name |
| The name of the demographic attribute. |
value |
| The list of all the possible values for this attribute. |
Name | Type | Required | Description |
cortexToken |
| yes |
subjects |
| yes | A list a subject names. |
Name | Type | Description |
success |
| For each subject you successfully deleted, this array contains an object with the name of deleted subject. |
failure |
| For each subject you failed to delete, this array contains an object that describes the error. |
Name | Type | Description |
subjectName |
| The name of the deleted subject. |
A token returned by .
A token returned by .