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

Attribute

Required

Type

Description

type

string

must be interlocutor

userID

string

your ID for this interlocutor (0 < length < 100)

firstName

string

interlocutor's first name

lastName

string

interlocutor's last name

email

string

interlocutor's email

phoneNumber

string

interlocutor's phone number

customAttributes

object

custom attributes (keys must only contain letters, digits and underscores)

socketToken

string

a 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

Attribute

Type

Description

data

object

the interlocutor object

data.id

string

interlocutor ID

data.type

string

always interlocutor

data.socketToken

string

if 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