GET /ai/{aiid}/chat

Updated 4 months ago by Maurizio Cibelli

Request parameters

name

type

description

Authorization

header

Developer token

chatId

query

q

query

Response Codes

code

condition

200

Succeeded.

202

Unable to respond in time, try again

404

AI not found

400

The AI is not trained

500

Internal error

Response Body

media type

data type

description

application/json

ChatResult (JSON)

Example

Request
GET /ai/{aiid}/chat
Content-Type: */*
Accept: application/json

Response
{
"answer" : "...",
"query" : "...",
"score" : 12345.0,
"topicOut" : "...",
"elapsedTime" : 12345.0,
"chatId" : "...",
"intents" : [ {
"aiid" : "...",
"chatId" : "...",
"unfulfilledVariables" : [ {
"requested" : true,
"name" : "...",
"currentValue" : "...",
"mandatory" : true,
"entityKeys" : [ "...", "..." ],
"timesPrompted" : 12345,
"timesToPrompt" : 12345,
"isPersistent" : true,
"resetOnEntry" : true,
"prompts" : [ "...", "..." ],
"system" : true,
"valueType" : "SYS",
"label" : "...",
"promptIndex" : 12345
}, {
"requested" : true,
"name" : "...",
"currentValue" : "...",
"mandatory" : true,
"entityKeys" : [ "...", "..." ],
"timesPrompted" : 12345,
"timesToPrompt" : 12345,
"isPersistent" : true,
"resetOnEntry" : true,
"prompts" : [ "...", "..." ],
"system" : true,
"valueType" : "LIST",
"label" : "...",
"promptIndex" : 12345
} ],
"fulfilled" : true,
"variables" : [ {
"requested" : true,
"name" : "...",
"currentValue" : "...",
"mandatory" : true,
"entityKeys" : [ "...", "..." ],
"timesPrompted" : 12345,
"timesToPrompt" : 12345,
"isPersistent" : true,
"resetOnEntry" : true,
"prompts" : [ "...", "..." ],
"system" : true,
"valueType" : "SYS",
"label" : "...",
"promptIndex" : 12345
}, {
"requested" : true,
"name" : "...",
"currentValue" : "...",
"mandatory" : true,
"entityKeys" : [ "...", "..." ],
"timesPrompted" : 12345,
"timesToPrompt" : 12345,
"isPersistent" : true,
"resetOnEntry" : true,
"prompts" : [ "...", "..." ],
"system" : true,
"valueType" : "SYS",
"label" : "...",
"promptIndex" : 12345
} ],
"variablesMap" : {
"property1" : {
"requested" : true,
"name" : "...",
"currentValue" : "...",
"mandatory" : true,
"entityKeys" : [ "...", "..." ],
"timesPrompted" : 12345,
"timesToPrompt" : 12345,
"isPersistent" : true,
"resetOnEntry" : true,
"prompts" : [ "...", "..." ],
"system" : true,
"valueType" : "SYS",
"label" : "...",
"promptIndex" : 12345
},
"property2" : {
"requested" : true,
"name" : "...",
"currentValue" : "...",
"mandatory" : true,
"entityKeys" : [ "...", "..." ],
"timesPrompted" : 12345,
"timesToPrompt" : 12345,
"isPersistent" : true,
"resetOnEntry" : true,
"prompts" : [ "...", "..." ],
"system" : true,
"valueType" : "REGEX",
"label" : "...",
"promptIndex" : 12345
}
},
"name" : "..."
}, {
"aiid" : "...",
"chatId" : "...",
"unfulfilledVariables" : [ {
"requested" : true,
"name" : "...",
"currentValue" : "...",
"mandatory" : true,
"entityKeys" : [ "...", "..." ],
"timesPrompted" : 12345,
"timesToPrompt" : 12345,
"isPersistent" : true,
"resetOnEntry" : true,
"prompts" : [ "...", "..." ],
"system" : true,
"valueType" : "REGEX",
"label" : "...",
"promptIndex" : 12345
}, {
"requested" : true,
"name" : "...",
"currentValue" : "...",
"mandatory" : true,
"entityKeys" : [ "...", "..." ],
"timesPrompted" : 12345,
"timesToPrompt" : 12345,
"isPersistent" : true,
"resetOnEntry" : true,
"prompts" : [ "...", "..." ],
"system" : true,
"valueType" : "LIST",
"label" : "...",
"promptIndex" : 12345
} ],
"fulfilled" : true,
"variables" : [ {
"requested" : true,
"name" : "...",
"currentValue" : "...",
"mandatory" : true,
"entityKeys" : [ "...", "..." ],
"timesPrompted" : 12345,
"timesToPrompt" : 12345,
"isPersistent" : true,
"resetOnEntry" : true,
"prompts" : [ "...", "..." ],
"system" : true,
"valueType" : "REGEX",
"label" : "...",
"promptIndex" : 12345
}, {
"requested" : true,
"name" : "...",
"currentValue" : "...",
"mandatory" : true,
"entityKeys" : [ "...", "..." ],
"timesPrompted" : 12345,
"timesToPrompt" : 12345,
"isPersistent" : true,
"resetOnEntry" : true,
"prompts" : [ "...", "..." ],
"system" : true,
"valueType" : "SYS",
"label" : "...",
"promptIndex" : 12345
} ],
"variablesMap" : {
"property1" : {
"requested" : true,
"name" : "...",
"currentValue" : "...",
"mandatory" : true,
"entityKeys" : [ "...", "..." ],
"timesPrompted" : 12345,
"timesToPrompt" : 12345,
"isPersistent" : true,
"resetOnEntry" : true,
"prompts" : [ "...", "..." ],
"system" : true,
"valueType" : "SYS",
"label" : "...",
"promptIndex" : 12345
},
"property2" : {
"requested" : true,
"name" : "...",
"currentValue" : "...",
"mandatory" : true,
"entityKeys" : [ "...", "..." ],
"timesPrompted" : 12345,
"timesToPrompt" : 12345,
"isPersistent" : true,
"resetOnEntry" : true,
"prompts" : [ "...", "..." ],
"system" : true,
"valueType" : "REGEX",
"label" : "...",
"promptIndex" : 12345
}
},
"name" : "..."
} ],
"history" : "...",
"aiid" : "...",
"webhookResponse" : {
"text" : "...",
"facebookNode" : {
"text" : "...",
"deprecatedFormat" : true,
"quickReplies" : [ { }, { } ],
"attachment" : { },
"payload" : { },
"contentType" : "file"
},
"chatContext" : {
"intentScore" : 12345.0,
"variablesAsStringMap" : {
"property1" : "...",
"property2" : "..."
}
},
"token" : "...",
"facebookNodes" : [ {
"text" : "...",
"deprecatedFormat" : true,
"quickReplies" : [ { }, { } ],
"attachment" : { },
"payload" : { },
"contentType" : "image"
}, {
"text" : "...",
"deprecatedFormat" : true,
"quickReplies" : [ { }, { } ],
"attachment" : { },
"payload" : { },
"contentType" : "image"
} ]
},
"promptForIntentVariable" : "...",
"timestamp" : 12345,
"chatTarget" : "...",
"chatState" : {
"empty" : { },
"timestamp" : 12345,
"lockedAiid" : "...",
"topic" : "...",
"history" : "...",
"confidenceThreshold" : 12345.0,
"chatTarget" : "Other",
"aiChatServices" : {
"minPMap" : {
"property1" : 12345.0,
"property2" : 12345.0
}
},
"ai" : {
"uiTrainingState" : { },
"canChat" : true,
"linkedBots" : [ 12345, 12345 ],
"summaryStatusPublic" : "AI_UNDEFINED",
"aiid" : "...",
"client_token" : "...",
"summaryAiStatus" : "AI_UNDEFINED",
"confidence" : 12345.0,
"backendStatus" : { },
"passthroughUrl" : "...",
"name" : "...",
"description" : "...",
"isPrivate" : true,
"personality" : 12345,
"voice" : 12345,
"language" : "...",
"timezone" : "...",
"defaultChatResponses" : [ "...", "..." ],
"readOnly" : true,
"handoverResetTimeoutSeconds" : 12345,
"errorThresholdHandover" : 12345,
"handoverMessage" : "...",
"engineVersion" : "...",
"status" : { }
},
"resetHandoverTime" : 12345,
"badAnswersCount" : 12345,
"chatContext" : {
"intentScore" : 12345.0,
"variablesAsStringMap" : {
"property1" : "...",
"property2" : "..."
}
},
"currentIntents" : [ {
"aiid" : "...",
"chatId" : "...",
"unfulfilledVariables" : [ { }, { } ],
"fulfilled" : true,
"variables" : [ { }, { } ],
"variablesMap" : {
"property1" : { },
"property2" : { }
},
"name" : "..."
}, {
"aiid" : "...",
"chatId" : "...",
"unfulfilledVariables" : [ { }, { } ],
"fulfilled" : true,
"variables" : [ { }, { } ],
"variablesMap" : {
"property1" : { },
"property2" : { }
},
"name" : "..."
} ],
"candidateValues" : {
"property1" : [ "...", "..." ],
"property2" : [ "...", "..." ]
},
"restartChatWorkflow" : true,
"inIntentLoop" : true,
"webhookSessions" : [ {
"expiryTimestamp" : 12345,
"token" : "...",
"maxUses" : 12345
}, {
"expiryTimestamp" : 12345,
"token" : "...",
"maxUses" : 12345
} ],
"integrationData" : {
"integrationType" : "SLACK"
},
"devId" : "...",
"hashedChatId" : "...",
"chatId" : "..."
},
"context" : {
"property1" : "...",
"property2" : "..."
},
"richAnswer" : {
"facebookNode" : {
"text" : "...",
"deprecatedFormat" : true,
"quickReplies" : [ { }, { } ],
"attachment" : { },
"payload" : { },
"contentType" : "template"
},
"facebookNodes" : [ {
"text" : "...",
"deprecatedFormat" : true,
"quickReplies" : [ { }, { } ],
"attachment" : { },
"payload" : { },
"contentType" : "video"
}, {
"text" : "...",
"deprecatedFormat" : true,
"quickReplies" : [ { }, { } ],
"attachment" : { },
"payload" : { },
"contentType" : "image"
} ]
}}


How did we do?