Create an interlocutor

In order to create an interlocutor you need to provide a userID.
This userID must have been generated by you, and will represent this interlocutor.

Note that if an interlocutor already exists with the same userID, the existing interlocutor is returned.

Request

AttributeRequiredTypeDescription
typestringmust be interlocutor
userIDstringyour ID for this interlocutor (0 < length < 100)
firstNamestringinterlocutor's first name
lastNamestringinterlocutor's last name
emailstringinterlocutor's email
phoneNumberstringinterlocutor's phone number
customAttributesobjectcustom attributes (keys must only contain letters, digits and underscores)
socketTokenstringa security token set for the interlocutor. Must be set if this token must be known by the integrating website (in logged envirnement fro example). Otherwise might be automatically generated by clustaar (with query param 'use_websocket')
{
    "type": "interlocutor",
    "id": "5b29016e24acbe58c292bbad",
    "userID": "123456",
    "firstName": "John",
    "lastName": "Doe",
    "phoneNumber": "0612239588"
    "email": "[email protected]",
    "customAttributes": {
        "age": "29"
    }
}

Response

AttributeTypeDescription
dataobjectthe interlocutor object
data.idstringinterlocutor ID
data.typestringalways interlocutor
data.socketTokenstringif use_websocket is passed in query parameters, socketToken is returned, but only once for security reason.
{
    "data": {
        "id": "58468b1978ad4421b0efc77a",
        "type": "interlocutor",
      	"socketToken":"fezfl3z4nfl5224zef6n_nfkj7znf735nze"
    }
}
Language