createSubject

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

Parameters

Result

The result is a subject object representing the new subject.

Examples

Create a subject with only his name.

{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "createSubject",
    "params": {
        "cortexToken": "xxx",
        "subjectName": "Bob Smith"
    }
}

Create a subject with more information.

{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "createSubject",
    "params": {
        "cortexToken": "xxx",
        "subjectName": "Alice Smith",
        "city": "London",
        "countryCode": "GB",
        "dateOfBirth": "1980-12-25",
        "sex": "F",
        "attributes": [
            {
                "name": "Handedness",
                "value": "Left"
            },
            {
                "name": "Education",
                "value": "Master's degree"
            }
        ]
    }
}

Last updated