arrow-left

All pages
gitbookPowered by GitBook
1 of 11

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

exportRecord

This method is to export one or more records to EDF or CSV files.

You can export the raw EEG data, the motion data, the performance metrics and the band powers. The available data streams depend on the license of the record. You can check the field licenceScope in the Record object to know which data streams are available.

By default, you can only export the records that were created by your application. If you want to export a record that was created by another application (e.g. Emotiv PROarrow-up-right or EMOTIV LABSarrow-up-right) then you must provide the license id of this application in the parameter licenseIds.

In order to export a record created by EMOTIV LABSarrow-up-right, the current Cortex user must be the owner of the LABS experiment.

You must before you can export it. If you want to export a record immediately after you stop it then you must wait for the before you try to export.

The format of the exported files is described in .

This method was added in Cortex 2.1.1 to all desktop versions of Cortex. It was added to iOS and Android in Cortex 2.7.0

hashtag
Parameters

hashtag
Data streams

The parameter streamTypes must contain one or more values, chosen from this list: "EEG", "MOTION", "PM", "BP". If the format is "EDF" then only "EEG" and "MOTION" are available.

hashtag
Format and version

Depending on the parameters format and version Cortex will create different files.

hashtag
Format EDF, no version

This format is identical to the one used in Cortex 1.x

  • 1 EDF file for the EEG and CQ data

  • 1 EDF file for the motion data

  • 1 JSON file for the markers

Format EDFPLUS/BDFPLUS, no version (available since Cortex version 3.7.5)

  • 1 EDF+/BDF+ file for the EEG, CQ and Motion data

  • 1 JSON file for the markers

  • 1 CSV file for the markers if the parameter includeMarkerExtraInfos is true

hashtag
Format CSV, version V1

This format is identical to the one used in Cortex 1.x

  • 1 CSV file for the EEG and CQ data

  • 1 CSV file for the band powers

  • 1 CSV file for the motion data

hashtag
Format CSV, version V2

This format is the new format of Cortex 2.x

  • 1 CSV file for all the data streams (EEG, CQ, band powers, motion, PM)

  • 1 JSON file for the markers

  • 1 CSV file for the markers if the parameter includeMarkerExtraInfos is true

hashtag
Result

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:

hashtag
Examples

hashtag
EDF

hashtag
CSV V1

hashtag
CSV V2

yes

The path of a local folder. Cortex will write the exported files in that folder. You must create this folder before you call this method. Cortex will return an error if the folder doesn't exist.

On iOS, this parameter doesn't exist. Cortex exports the data to the "Documents" folder of the current application.

streamTypes

array of strings

yes

List of the data streams you want to export.

format

string

yes

The format of the exported files. Must be "EDF", "EDFPLUS", "BDFPLUS" or "CSV".

version

string

no

If the format is "EDF", then you must omit this parameter.

If the format is "CSV", then this parameter must be "V1" or "V2".

licenseIds

array of strings

no

The default value is an empty list, which means that you can only export the records created by your application. You can provide the license ID of other applications in order to export the records created by these applications.

This parameter was added in Cortex 2.6.3

includeDemographics

boolean

no

If true then the exported JSON file will include the demographic data of the user. It is only for the records created by .

The default value is false.

This parameter was added in Cortex 2.6.3

includeSurvey

boolean

no

If true then the exported JSON file will include the survey data of the record. It is only for the records created by .

The default value is false.

This parameter was added in Cortex 2.6.3 From Cortex 3.5.0, survey data will be exported in a separate CSV file (along with JSON file).

includeMarkerExtraInfos

boolean

no

If true then the markers of the records will be exported to a CSV file. This file is compatible with .

The default value is false.

This parameter was added in Cortex 2.6.3

includeDeprecatedPM

boolean

no

If true then deprecated performance metrics (i.e. Focus) will be exported.

The default value is false. This parameter was added in Cortex 3.5.6

Export the band powers of each EEG sensor.

1 CSV file for the markers if the parameter includeMarkerExtraInfos is true
1 CSV file for the performance metrics
  • 1 JSON file for the markers

  • 1 CSV file for the markers if the parameter includeMarkerExtraInfos is true

  • Name

    Type

    Required

    Description

    cortexToken

    string

    yes

    A token returned by authorize.

    recordIds

    array of strings

    yes

    An array of record ids. These are the ids of the records you want to export.

    folder

    Stream

    Description

    EEG

    Export the raw EEG data, the contact quality of each EEG sensor, and the markers. The license scope of the record must contain the scope "eeg".

    MOTION

    Export the motion data.

    PM

    Export the results of the performance metric detection.

    If the license scope of the record contains the scope "pm" then Cortex will export the high resolution performance metrics, at 2 hertz. Otherwise Cortex will export the low resolution data, at 0.1 hertz.

    MC

    Export the results of the mental command detection.

    FE

    Export the results of the facial expression detection.

    Name

    Type

    Description

    success

    array of objects

    For each record you successfully exported, this array contains an object that includes the record id.

    failure

    array of objects

    For each record that couldn't be exported, this array contains an object that describes the error.

    Name

    Type

    Description

    recordId

    string

    The id of the record that was successfully exported.

    Name

    Type

    Description

    recordId

    string

    The id of the record that couldn't be exported.

    code

    number

    The error code.

    message

    string

    The error message.

    stop the record
    warning 30
    EmotivPRO user manualarrow-up-right

    string

    BP

    updateRecord

    This method is to update a record. You can update its title, description and its tags.

    Your application cannot update a record that was created by another application.

    hashtag
    Parameters

    Name

    hashtag
    Result

    The result is a .

    hashtag
    Examples

    Update the tags and the description.

    Records

    After you opened a with a headset, you can create a record. A record is a permanent object to store data from an EMOTIV headset. You can associate a to a record. You can add one or more to a record.

    Unlike a , a record is a permanent object. It is stored on the hard drive and then can be synchronized to the EMOTIV cloud. The configuration can let you decide if the records of a user are uploaded to the cloud or not.

    hashtag
    Record lifetime

    createRecord

    This method is to create a new record.

    circle-info

    You must create and activate a session before you call this method. See for details.

    hashtag

    stopRecord

    This method is to stop a record that was previously started by . This will set the end date time of the record to the current date time.

    hashtag
    Parameters

    deleteRecord

    This method is to delete one or more records.

    The records will be deleted from the local computer, but also from the EMOTIV account of the user in the cloud, and from any computer where the user is logged in.

    Your application cannot delete a record that was created by another application.

    triangle-exclamation

    Deleting a record is irreversible. There is no way to recover a deleted record.

    requestToDownloadRecordData

    This method is to ask Cortex to download the EEG/motion/CQ/detections data of a record from the EMOTIV cloud.

    hashtag
    Use case

    Suppose that the user has installed Cortex on 2 computers, named computer A and computer B. On computer A, the user creates a record, and Cortex uploads this record to the EMOTIV cloud.

    Then, on computer B, Cortex automatically downloads the metadata of this record, ie its name, description, start time, end time, etc... So this record is visible when you call methods like or

    {
        "id": 1,
        "jsonrpc": "2.0",
        "method": "exportRecord",
        "params": {
            "cortexToken": "xxx",
            "folder": "/tmp/edf",
            "format": "EDF",
            "recordIds": [
                "ec0ac33f-ad4e-48b1-bbc3-8502f5c49b62"
            ],
            "streamTypes": [
                "EEG",
                "MOTION"
            ]
        }
    }
    {
        "id": 1,
        "jsonrpc": "2.0",
        "result": {
            "failure": [],
            "success": [
                {
                    "recordId": "ec0ac33f-ad4e-48b1-bbc3-8502f5c49b62"
                }
            ]
        }
    }
    {
        "id": 1,
        "jsonrpc": "2.0",
        "method": "exportRecord",
        "params": {
            "cortexToken": "xxx",
            "folder": "/tmp/csv1",
            "format": "CSV",
            "recordIds": [
                "ec0ac33f-ad4e-48b1-bbc3-8502f5c49b62"
            ],
            "streamTypes": [
                "EEG",
                "MOTION",
                "PM",
                "BP"
            ],
            "version": "V1"
        }
    }
    {
        "id": 1,
        "jsonrpc": "2.0",
        "result": {
            "failure": [],
            "success": [
                {
                    "recordId": "ec0ac33f-ad4e-48b1-bbc3-8502f5c49b62"
                }
            ]
        }
    }
    {
        "id": 1,
        "jsonrpc": "2.0",
        "method": "exportRecord",
        "params": {
            "cortexToken": "xxx",
            "folder": "/tmp/csv2",
            "format": "CSV",
            "recordIds": [
                "ec0ac33f-ad4e-48b1-bbc3-8502f5c49b62"
            ],
            "streamTypes": [
                "EEG",
                "MOTION",
                "PM",
                "BP"
            ],
            "version": "V2"
        }
    }
    {
        "id": 1,
        "jsonrpc": "2.0",
        "result": {
            "failure": [],
            "success": [
                {
                    "recordId": "ec0ac33f-ad4e-48b1-bbc3-8502f5c49b62"
                }
            ]
        }
    }
    EMOTIV LABSarrow-up-right
    EMOTIV LABSarrow-up-right
    EEGLABarrow-up-right
    First, you must open a session with a headset. Then you call createRecord to start a new record. When the record is in progress, you can add markers to this record. You stop a record with updateRecord.

    The record is linked to the session, so if you close the session, or if your application is disconnected from the Cortex service, then Cortex will automatically close the record.

    After you stop the record you can export its data to a CSV or EDF file using exportRecord.

    session
    subject
    markers
    session
    opt-out

    Type

    Required

    Description

    cortexToken

    string

    yes

    A token returned by authorize.

    record

    string

    yes

    A record id returned by createRecord.

    title

    string

    no

    The new title of the record.

    This parameter was added in Cortex 2.5.0

    description

    string

    no

    The new description of the record. Omit this parameter if you don't want to update the description.

    tags

    array of strings

    no

    The new tags of the record.Omit this parameter if you don't want to update the tags.

    record object
    {
        "id": 1,
        "jsonrpc": "2.0",
        "method": "updateRecord",
        "params": {
            "cortexToken": "xxx",
            "record": "d8fe7658-71f1-4cd6-bb5d-f6775b03438f",
            "description": "My best record ever.",
            "tags": ["best", "snow", "direwolf"]
        }
    }
    {
        "id": 1,
        "jsonrpc": "2.0",
        "result": {
            "applicationId": "com.jon.snow.winterfell-app",
            "applicationVersion": "1.0",
            "description": "My best record ever.",
            "endDatetime": "2019-06-06T11:42:23.436191+07:00",
            "experimentId": 0,
            "licenseId": "xxx",
            "licenseScope": ["pm","eeg"],
            "ownerId": "76c3468a-d9c0-428d-81b4-bdac5d63860e",
            "startDatetime": "2019-06-06T11:41:53.088632+07:00",
            "tags": ["best", "snow", "direwolf"],
            "title": "Cortex Examples C++",
            "uuid": "d8fe7658-71f1-4cd6-bb5d-f6775b03438f"
        }
    }
    Parameters

    Name

    Type

    Required

    Description

    cortexToken

    string

    yes

    A token returned by .

    session

    string

    yes

    A session id returned by .

    title

    hashtag
    Result

    The result is an object containing two fields:

    Name

    Type

    Description

    record

    object

    A that represents the created record.

    sessionId

    string

    The id of the session this record is linked to.

    hashtag
    Examples

    createSession

    cortexToken

    string

    yes

    A token returned by .

    session

    string

    yes

    The session id you provided when you called .

    A record is linked to a session. So to close a record, you need to provide the session id.

    hashtag
    Result

    The result is an object containing these fields:

    Name

    Type

    Description

    record

    object

    A .

    sessionId

    string

    The session id linked to the record.

    hashtag
    Example

    {
        "id": 1,
        "
    
    {
        "id": 1,
        "
    

    Name

    Type

    Required

    createRecord

    Description

    hashtag
    Parameters

    Name

    Type

    Required

    Description

    cortexToken

    string

    yes

    A token returned by .

    records

    array of strings

    yes

    An array of record ids.

    hashtag
    Result

    The result is an object that includes these fields:

    Name

    Type

    Description

    success

    array of objects

    For each record you successfully deleted, this array contains an object that includes the record id.

    failure

    array of objects

    For each record that couldn't be deleted, this array contains an object that describes the error.

    In case of success, you get an object with these fields:

    Name

    Type

    Description

    recordId

    string

    The id of the record that was successfully deleted.

    In case of failure, you get an object with these fields:

    Name

    Type

    Description

    recordId

    string

    The id of the record that couldn't be deleted.

    code

    number

    The error code.

    message

    string

    The error message.

    hashtag
    Examples

    Deleting two records, including one that has an invalid id.

    .

    But Cortex doesn't automatically download the actual data of the record, ie the EEG, motion, CQ, the results of the detections, etc... So you cannot export this record. To download the actual data, you must call the method "requestToDownloadRecordData".

    hashtag
    Parameters

    Name
    Type
    Required
    Description

    cortexToken

    string

    yes

    A token returned by .

    recordIds

    array of strings

    yes

    A list of record ids.

    hashtag
    Result

    The result is an object with 2 fields:

    Name
    Type
    Description

    success

    array of objects

    List of the records that Cortex will start to download.

    failure

    array of objects

    List of the records that Cortex will not download.

    Each object in the success array include these fields:

    Name
    Type
    Description

    recordId

    string

    The id of a record that was added to the Cortex download queue.

    Cortex will now start the download.

    Each object in the failure array include these fields:

    Name
    Type
    Description

    recordId

    string

    The id of a record that Cortex cannot download.

    code

    number

    The error code for this record.

    message

    string

    The error message for this record.

    hashtag
    Example

    queryRecord
    getRecordInfos

    queryRecords

    This method returns a list of records owned by the current user. By default, you only get the records created by your application. To query the records from another application, you must filter by the license id of this application.

    hashtag
    Parameters

    Name

    Type

    Required

    triangle-exclamation

    Depending on the query, this method may return a lot of records. To avoid performance issues, you should always set an offset and a limit.

    hashtag
    query

    The query object can contain one or more of these fields:

    hashtag
    orderBy

    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 record'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 records by their start date, in descending order, you must use the object {"startDatetime":"DESC"}. To sort the records by title, in alphabetical order, you must use {"title":"ASC"}.

    You can order the records by these fields: title, description, startDatetime, modifiedDatetime, duration, subjectName, applicationId. The option to order by applicationId was added in Cortex 2.5.0

    hashtag
    limit and offset

    These parameters are to implement pagination. It useful if you want to display the records in a UI. You must order the results to use these parameters.

    First you should call this method with an 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 records for your query.

    hashtag
    Result

    The result is an object that includes these fields:

    hashtag
    Examples

    Get the 10 most recent records created by EmotivPRO.

    Get some records using a keyword.

    Record object

    Some methods of the API return one or more record objects, for example queryRecords.

    hashtag
    Description

    A record object includes these fields:

    Name

    Depending on how you get the record, it may contains an additional field for the markers:

    hashtag
    syncStatus

    Record object returned from getRecordInfos has an additional field syncStatus:

    Available values for status:

    • "pending": the record is waiting for being downloaded.

    • "downloading": the record's data is being downloaded. Check progress in percent field.

    • "downloaded": the record's data is on both the Emotiv Cloud and the local machine.

    For example:

    • A record is created but waiting for being uploaded to the Emotiv Cloud:

    • A record is waiting for downloaded from the Emotiv Cloud:

    • A record is created and is uploading to the Emotiv Cloud:

    hashtag
    Examples

    getRecordInfos

    This method returns a list of records, selected by their id.

    hashtag
    Parameters

    Name

    Type

    Required

    Description

    hashtag
    Result

    The result is an array of , including the markers of each record.

    hashtag
    Examples

    configOptOut

    This method is to configure the opt-out feature for the records. This feature lets you decide if the records created by your application on the local machine are uploaded to the EMOTIV cloud or not.

    If the opt-out is on (ie the parameter newOptOut is true) then the records created on this machine will not be uploaded to the cloud. If the opt-out is off (ie the parameter newOptOut is false) then the records created on this machine will be uploaded to the cloud.

    Please note that changing the opt-out configuration has no effect on the records previously created on the local computer. It only affects the records created after the change. Changing the opt-out configuration is not retroactive.

    The opt-out configuration is linked to your application. Changing the configuration only affects the records created by your application. This has no effect on the records created by other applications.

    The opt-out configuration is also linked to the EmotivID of the user. The opt-out can be turned on or off for each EmotivID. It is off by default.

    You can check the field localOnly of a to know if this record will stay on the local machine, or if it will be uploaded to the EMOTIV cloud.

    Some don't let you change the opt-out configuration and force the opt-out to be always on or always off. See the possible configurations below for details.

    This method was added in Cortex 2.2.1

    hashtag
    Parameters

    hashtag
    Result

    The result is an object describing the current opt-out configuration. It includes these fields:

    hashtag
    Possible Configurations

    Here is an overview of the possible configurations:

    hashtag
    Examples

    hashtag
    Get the current configuration

    hashtag
    Change the configuration

    {
        "id": 1,
        "jsonrpc": "2.0",
        "method": "createRecord",
        "params": {
            "cortexToken": "xxx",
            "session": "1067dc90-eb17-489b-9514-69cb79ac696c",
            "title": "Cortex Examples C++"
        }
    }
    {
        "id": 1,
        "jsonrpc": "2.0",
        "result": {
            "record": {
                "uuid": "222eb845-bc44-4a01-bf28-07445a7c7e8a",
                "applicationId": "com.jon.snow.winterfell-app",
                "applicationVersion": "1.0",
                "description": "",
                "endDatetime": "",
                "experimentId": 0,
                "licenseId": "xxx",
                "licenseScope": ["pm","eeg"],
                "ownerId": "76c3468a-d9c0-428d-81b4-bdac5d63860e",
                "startDatetime": "2019-05-31T11:06:24.398560+07:00",
                "tags": [],
                "title": "Cortex Examples C++"
            },
            "sessionId": "1067dc90-eb17-489b-9514-69cb79ac696c"
        }
    }
    {
        "id": 1,
        "jsonrpc": "2.0",
        "method": "deleteRecord",
        "params": {
            "cortexToken": "xxx",
            "records": [
                "d8fe7658-71f1-4cd6-bb5d-f6775b03438f",
                "invalid-id"
            ]
        }
    }
    {
        "id": 1,
        "jsonrpc": "2.0",
        "result": {
            "success": [
                {"recordId":"d8fe7658-71f1-4cd6-bb5d-f6775b03438f"}
            ],
            "failure": [
                {"recordId":"invalid-id","code":1234,"message":"..."}
            ]
        }
    }
    {
      "id": 1,
      "jsonrpc": "2.0",
      "method": "requestToDownloadRecordData",
      "params": {
        "cortexToken": "xxx",
        "recordIds": [
            "33a9aa44-5a90-4881-8613-78493752b86d", 
            "3a4b7eb0-3b6c-4e16-a480-cbda8181f092"
          ]
      }
    }
    {
      "id": 1,
      "jsonrpc": "2.0",
      "result": {
        "failure": [{
          "code": -32186,
          "message": "The record already exists.",
          "recordId": "33a9aa44-5a90-4881-8613-78493752b86d"
        }],
        "success": [{
          "recordId": "3a4b7eb0-3b6c-4e16-a480-cbda8181f092"
        }]
      }
    }

    string

    yes

    The title of the record. Must be 200 characters or less.

    description

    string

    no

    The description of the record.

    subjectName

    string

    no

    The name of a subject created by createSubject. The subject is the person wearing the headset during the record. If you omit this field, then Cortex assumes that the current user is using the headset.

    tags

    array of strings

    no

    A list of tags you can associate to this record. You can use queryRecords to search the records by tags.

    experimentId

    number (integer)

    no

    An experiment id you can associate to this record. If you omit this parameter then the experimentId of the record will be zero.

    This parameter was added in Cortex 2.2.1

    authorize
    createSession
    record object
    jsonrpc
    "
    :
    "
    2.0
    "
    ,
    "method": "stopRecord",
    "params": {
    "cortexToken": "xxx",
    "session": "38fef6d7-979b-420b-aa25-dd60ef5edc02"
    }
    }
    jsonrpc
    "
    :
    "
    2.0
    "
    ,
    "result": {
    "record": {
    "applicationId": "com.jon.snow.winterfell-app",
    "applicationVersion": "1.0",
    "description": "",
    "endDatetime": "2019-06-06T11:42:23.436191+07:00",
    "experimentId": 0,
    "licenseId": "xxx",
    "licenseScope": ["pm","eeg"],
    "ownerId": "76c3468a-d9c0-428d-81b4-bdac5d63860e",
    "startDatetime": "2019-06-06T11:41:53.088632+07:00",
    "tags": [],
    "title": "Cortex Examples C++",
    "uuid": "d8fe7658-71f1-4cd6-bb5d-f6775b03438f"
    },
    "sessionId": "38fef6d7-979b-420b-aa25-dd60ef5edc02"
    }
    }
    authorize
    createRecord
    record object
    authorize
    authorize

    cortexToken

    string

    yes

    A token returned by authorize.

    recordIds

    array of strings

    yes

    A list of records id.

    record objects
    {
        "id": 1,
        "jsonrpc": "2.0",
        "method": "getRecordInfos",
        "params": {
            "cortexToken": "xxx",
            "recordIds": ["db01c15e-d916-4a7b-9f1d-16295fd1c643"]
        }
    }
    {
        "id": 1,
        "jsonrpc": "2.0",
        "result": [{
            "applicationId": "com.jon.snow.winterfell-app",
            "applicationVersion": "1.0",
            "description": "",
            "endDatetime": "2019-06-06T15:57:58.472229+07:00",
            "experimentId": 0,
            "licenseId": "xxx",
            "licenseScope": [
                "pm",
                "eeg"
            ],
            "markers": [
                {
                    "endDatetime": "2019-06-06T15:57:33.523627+07:00",
                    "extras": {},
                    "label": "test1",
                    "port": "Cortex Example",
                    "startDatetime": "2019-06-06T15:57:33.523627+07:00",
                    "type": "instance",
                    "uuid": "3e8d3a26-f4bf-486c-8ece-6efb8b739a51",
                    "value": 41
                },
                {
                    "endDatetime": "2019-06-06T15:57:49.530743+07:00",
                    "extras": {},
                    "label": "test2",
                    "port": "Cortex Example",
                    "startDatetime": "2019-06-06T15:57:41.529661+07:00",
                    "type": "interval",
                    "uuid": "26fccfd8-e487-4623-910a-1ba8591fcdcf",
                    "value": 42
                }
            ],
            "ownerId": "76c3468a-d9c0-428d-81b4-bdac5d63860e",
            "startDatetime": "2019-06-06T15:57:28.596410+07:00",
            "subject": {
                "subjectName": "Hodor"
            },
            "tags": [],
            "title": "Cortex Examples C++",
            "uuid": "db01c15e-d916-4a7b-9f1d-16295fd1c643"
        }]
    }

    An object with fields "from" and "to" to filter the records by their start date time.

    modifiedDatetime

    object

    An object with fields "from" and "to" to filter the records by their modification date time.

    duration

    object

    An object with fields "from" and "to" to filter the records by their duration.

    The offset you specified in the parameters.

    Description

    cortexToken

    string

    yes

    A token returned by authorize.

    query

    object

    yes

    An object to filter the records.

    orderBy

    array of objects

    yes

    Specify how to sort the records.

    limit

    number

    no

    The maximum number of records that this method should return. A limit of zero means no maximum.

    offset

    number

    no

    The number of record that this method should skip before returning the result. If the limit is zero, then Cortex will ignore this parameter.

    includeMarkers

    boolean

    no

    If true then the record objects in the result will include the markers linked to each record. The default value is false because a record may have a large number of markers.

    This parameter was added in Cortex 2.1

    includeSyncStatusInfo

    boolean

    no

    If true then the record object in the result will include the field "syncStatus". This field tells you if the record was uploaded to the EMOTIV cloud or not.

    The default value is false.

    This parameter was added in Cortex 2.6.3

    Name

    Type

    Description

    licenseId

    string

    Set this parameter to filter the records by their license.

    applicationId

    string

    If you set the licenseId, then you can set this parameter to further filter the records by application.

    keyword

    string

    Set this parameter to filter the records by title, description, or subject name.

    startDatetime

    Name

    Type

    Description

    records

    array of objects

    An array of record objects.

    count

    number

    The total number of records that match the query.

    limit

    number

    The limit you specified in the parameters.

    offset

    object

    number

    "notDownloaded": the record's data is on the Emotiv Cloud and not on the local machine.
  • "failedEncryption", "failedDownload": sync status of the record if requestToDownloadRecordData fails.

  • "notUploaded": the record is not uploaded to the Emotiv Cloud yet.

  • "uploading": the record is being uploaded to the Emotiv Cloud. Check progress in percent field.

  • "uploaded": the record is on both the Emotiv Cloud and the local machine.

  • "failedAccessFile", "failedDecryption", "failedUpload": sync status of the record whose uploading fails. Cortex will try uploading again.

  • "neverUploaded": The record will never be uploaded to the Emotiv Cloud. The record is created with virtual headsets in this case.

  • Type

    Description

    uuid

    string

    The id of this record.

    ownerId

    string

    The id of the user this record belongs to. It is a GUID, it is not the EmotivID of the user.

    applicationId

    string

    The id of the application that created this record.

    applicationVersion

    string

    The version of the application that created this record.

    title

    string

    The title of this record.

    description

    string

    The description of this record.

    tags

    array of strings

    The tags associated to this record.

    experimentId

    number (integer)

    The experiment id associated to this record.

    startDatetime

    string (ISO datetime)

    When this record was created.

    endDatetime

    string (ISO datetime)

    When this record was stopped.

    licenseId

    string

    The id of the license used by this record.

    licenseScope

    array of strings

    List of the data streams the license has access to.

    The scope "eeg" gives access to the raw EEG data.

    The scope "pm" gives access to the 2 hertz performance metrics.

    subject

    object

    This object has a single field "subjectName". It is the subject name used to create this record. You can use querySubjects to get more information about the subject. If the record was created without a subject name, then the field "subjectName" contains the EmotivID of the user.

    localOnly

    boolean

    If true then this record will not be uploaded to the EMOTIV cloud.

    If false then it will be uploaded.

    headbandPosition

    string

    If the headset is an EPOC X, then this field tells you the position of the headband of this headset during this record. Can be "back" or "top". If the headset is not an EPOC X, then this field is null. See updateHeadsetCustomInfo for details.

    This field was added in Cortex 2.4

    Name

    Type

    Description

    markers

    array of objects

    A list of marker objects. The markers added to this record.

    Name

    Type

    Description

    syncStatus

    object

    contain information of sync status (status field) and/or uploading/downloading progress (percent field).

    no

    If the status is "set" then you must set this parameter to true or false, in order to turn the opt-out feature on or off. If the status is "get" then you should omit this parameter.

    A text message.

    Always false

    The records will always be uploaded to the cloud. You cannot change the configuration.

    false

    true

    Always false

    The records will always be uploaded to the cloud. You cannot change the configuration.

    Name

    Type

    Required

    Description

    cortexToken

    string

    yes

    A token returned by authorize.

    status

    string

    yes

    Must be "get" or "set". Use "get" to read the current configuration of the opt-out feature. Use "set" to turn the opt-out on or off.

    newOptOut

    Name

    Type

    Description

    optOutAvail

    boolean

    If false then the opt-out is always off. The value of this field depends on the current license. Some license force you to upload the records to the cloud.

    forceOptOut

    boolean

    If true (and optOutAvail is also true) then the opt-out is always on. The value of this field depends on the current license. Some license don't let you upload the records to the cloud.

    currOptOut

    boolean

    The current configuration of the opt-out.

    If this value is true, then the records created by your application won't be uploaded to the cloud. If this value is false, then they will.

    message

    optOutAvail

    forceOptOut

    currOptOut

    Description

    true

    false

    Variable, false by default

    By default, currOptOut is false and the records created by your application will be uploaded to the cloud. You can change the opt-out configuration for each EmotivID.

    true

    true

    Always true

    The records will never be uploaded to the cloud. You cannot change the configuration.

    false

    Record object
    licenses

    boolean

    string

    false

    {
        "id": 1,
        "jsonrpc": "2.0",
        "method": "queryRecords",
        "params": {
            "cortexToken": "xxx",
            "limit": 10,
            "offset": 0,
            "orderBy": [
                { "startDatetime": "DESC" }
            ],
            "query": {
                "applicationId": "com.emotiv.emotivpro",
                "licenseId": "yyy"
            },
            "includeSyncStatusInfo": true
        }
    }
    {
      "id": 1,
      "jsonrpc": "2.0",
      "result": {
        "count": 1,
        "limit": 10,
        "offset": 0,
        "records": [{
          "applicationId": "com.emotiv.emotivpro",
          "applicationVersion": "2.6.3",
          "demographics": {
            "uuid": "",
            "validated": false
          },
          "description": "A simple experiment with a drone",
          "endDatetime": "2021-01-06T16:32:50.572490+07:00",
          "experimentId": 0,
          "headbandPosition": null,
          "licenseId": "yyy",
          "licenseScope": ["pm", "eeg"],
          "localOnly": false,
          "ownerId": "ddeca960-9336-4a51-a2d2-9cb6e8fd5524",
          "startDatetime": "2021-01-06T16:32:13.431865+07:00",
          "subject": {
            "subjectName": "Ben Kenobi"
          },
          "syncStatus": {
            "status": "neverUploaded"
          },
          "tags": [],
          "title": "Experiment 42",
          "uuid": "1f2a8f85-7200-400a-a8f0-fd5c0b331852"
        }]
      }
    }
    {
      "id": 1,
      "jsonrpc": "2.0",
      "method": "queryRecords",
      "params": {
        "cortexToken": "xxx",
        "includeMarkers": true,
        "limit": 2,
        "offset": 0,
        "orderBy": [
          {
            "startDatetime": "DESC"
          }
        ],
        "query": {
          "keyword": "Cortex Example"
        }
      }
    }
    {
      "id": 1,
      "jsonrpc": "2.0",
      "result": {
        "count": 9,
        "limit": 2,
        "offset": 0,
        "records": [
          {
            "applicationId": "com.xxx.cortex-examples",
            "applicationVersion": "1.0",
            "description": "",
            "endDatetime": "2020-03-09T15:59:34.794356+07:00",
            "experimentId": 0,
            "headbandPosition": null,
            "licenseId": "xxx",
            "licenseScope": [
              "pm",
              "eeg"
            ],
            "localOnly": false,
            "markers": [
              {
                "endDatetime": "2020-03-09T15:59:09.680802+07:00",
                "extras": {},
                "label": "test1",
                "port": "Cortex Example",
                "startDatetime": "2020-03-09T15:59:09.680802+07:00",
                "type": "instance",
                "uuid": "ba8ed3a9-3e0b-4a17-9227-96ae05fa1767",
                "value": 41
              },
              {
                "endDatetime": "2020-03-09T15:59:25.873059+07:00",
                "extras": {},
                "label": "test2",
                "port": "Cortex Example",
                "startDatetime": "2020-03-09T15:59:16.867054+07:00",
                "type": "interval",
                "uuid": "2cfe93cc-f242-49d6-8165-7b13147e7c10",
                "value": 42
              }
            ],
            "ownerId": "94f7c5ed-3d24-4c29-8243-96aa7db80d4a",
            "startDatetime": "2020-03-09T15:59:04.344671+07:00",
            "subject": {
              "subjectName": "Bob"
            },
            "tags": [],
            "title": "Cortex Examples C++",
            "uuid": "b26f35c3-42ee-4612-a9b9-09af04c2ba37"
          },
          {
            "applicationId": "com.xxx.cortex-examples",
            "applicationVersion": "1.0",
            "description": "",
            "endDatetime": "2020-03-09T15:58:37.792248+07:00",
            "experimentId": 0,
            "headbandPosition": null,
            "licenseId": "xxx",
            "licenseScope": [
              "pm",
              "eeg"
            ],
            "localOnly": false,
            "markers": [
              {
                "endDatetime": "2020-03-09T15:58:12.875515+07:00",
                "extras": {},
                "label": "test1",
                "port": "Cortex Example",
                "startDatetime": "2020-03-09T15:58:12.875515+07:00",
                "type": "instance",
                "uuid": "e22d46a0-480a-452a-a65e-d6b4448e3f7b",
                "value": 41
              },
              {
                "endDatetime": "2020-03-09T15:58:28.872019+07:00",
                "extras": {},
                "label": "test2",
                "port": "Cortex Example",
                "startDatetime": "2020-03-09T15:58:20.873850+07:00",
                "type": "interval",
                "uuid": "c8fd9191-43da-4e28-970d-bf9f24404c8a",
                "value": 42
              }
            ],
            "ownerId": "94f7c5ed-3d24-4c29-8243-96aa7db80d4a",
            "startDatetime": "2020-03-09T15:58:08.036369+07:00",
            "subject": {
              "subjectName": "Marie"
            },
            "tags": [],
            "title": "Cortex Examples C++",
            "uuid": "33d2c56a-4cdf-4e2b-a5bb-db127f838248"
          }
        ]
      }
    }
    {
        "status": "notUpload"
    }
    {
        "status": "pending"
    }
    {
        "status": "uploading",
        "percent": 30
    }
    {
        "applicationId": "com.jon.snow.winterfell-app",
        "applicationVersion": "1.0",
        "description": "",
        "startDatetime": "2019-06-06T15:57:28.596410+07:00",
        "endDatetime": "2019-06-06T15:57:58.472229+07:00",
        "experimentId": 0,
        "licenseId": "xxx",
        "licenseScope": [
            "pm",
            "eeg"
        ],
        "localOnly": false,
        "markers": [
            {
                "endDatetime": "2019-06-06T15:57:33.523627+07:00",
                "extras": {},
                "label": "test1",
                "port": "Cortex Example",
                "startDatetime": "2019-06-06T15:57:33.523627+07:00",
                "type": "instance",
                "uuid": "3e8d3a26-f4bf-486c-8ece-6efb8b739a51",
                "value": 41
            },
            {
                "endDatetime": "2019-06-06T15:57:49.530743+07:00",
                "extras": {},
                "label": "test2",
                "port": "Cortex Example",
                "startDatetime": "2019-06-06T15:57:41.529661+07:00",
                "type": "interval",
                "uuid": "26fccfd8-e487-4623-910a-1ba8591fcdcf",
                "value": 42
            }
        ],
        "ownerId": "76c3468a-d9c0-428d-81b4-bdac5d63860e",
        "subject": {
            "subjectName": "Hodor"
        },
        "tags": ["snow", "cold", "winter"],
        "title": "Cortex Examples C++",
        "uuid": "db01c15e-d916-4a7b-9f1d-16295fd1c643"
    }
    {
        "id": 1,
        "jsonrpc": "2.0",
        "method": "configOptOut",
        "params": {
            "cortexToken": "xxx",
            "status": "get"
        }
    }
    {
        "id": 1,
        "jsonrpc": "2.0",
        "result": {
            "currOptOut": false,
            "forceOptOut": false,
            "message": "Get opt-out configuration successfully",
            "optOutAvail": true
        }
    }
    {
        "id": 1,
        "jsonrpc": "2.0",
        "method": "configOptOut",
        "params": {
            "cortexToken": "xxx",
            "status": "set",
            "newOptOut": true
        }
    }
    {
        "id": 1,
        "jsonrpc": "2.0",
        "result": {
            "currOptOut": true,
            "forceOptOut": false,
            "message": "Update opt-out configuration successfully",
            "optOutAvail": true
        }
    }