POST /ai/import

Updated 4 months ago by Maurizio Cibelli

Imports an AI from file

Request Body

media type

data type

description

application/json

BotStructure(JSON)

Imports a bot from a JSON file. The imported bots can replace or not an existing bot depending on the AIID parameter.

Response Body

media type

data type

description

application/json

object (JSON)

Example

Request

{
"name" : "...",
"clientToken" : "...",
"description" : "...",
"intents" : [ {
"intentName" : "...",
"variables" : [ {
"entityName" : "...",
"devOwner" : "...",
"required" : true,
"numPrompts" : 12345,
"prompts" : [ "...", "..." ],
"value" : "...",
"persistent" : true,
"id" : 12345,
"label" : "...",
"lifetimeTurns" : 12345,
"clearOnEntry" : true
}, {
"entityName" : "...",
"devOwner" : "...",
"required" : true,
"numPrompts" : 12345,
"prompts" : [ "...", "..." ],
"value" : "...",
"persistent" : true,
"id" : 12345,
"label" : "...",
"lifetimeTurns" : 12345,
"clearOnEntry" : true
} ],
"userSays" : [ "...", "..." ],
"responses" : [ "...", "..." ],
"topicIn" : "...",
"topicOut" : "...",
"webHook" : {
"aiid" : "...",
"intentName" : "...",
"enabled" : true,
"endpoint" : "..."
},
"contextIn" : {
"property1" : "...",
"property2" : "..."
},
"contextOut" : {
"property1" : "...",
"property2" : "..."
},
"conditionsIn" : [ {
"variable" : "...",
"value" : "...",
"operator" : "SMALLER_THAN_OR_EQUALS"
}, {
"variable" : "...",
"value" : "...",
"operator" : "EQUALS"
} ],
"conditionsFallthroughMessage" : "...",
"resetContextOnExit" : true,
"intentOutConditionals" : [ {
"conditions" : [ { }, { } ],
"intentName" : "..."
}, {
"conditions" : [ { }, { } ],
"intentName" : "..."
} ],
"aiid" : "...",
"status" : {
"code" : 12345,
"success" : { },
"info" : "...",
"created" : { }
}
}, {
"intentName" : "...",
"variables" : [ {
"entityName" : "...",
"devOwner" : "...",
"required" : true,
"numPrompts" : 12345,
"prompts" : [ "...", "..." ],
"value" : "...",
"persistent" : true,
"id" : 12345,
"label" : "...",
"lifetimeTurns" : 12345,
"clearOnEntry" : true
}, {
"entityName" : "...",
"devOwner" : "...",
"required" : true,
"numPrompts" : 12345,
"prompts" : [ "...", "..." ],
"value" : "...",
"persistent" : true,
"id" : 12345,
"label" : "...",
"lifetimeTurns" : 12345,
"clearOnEntry" : true
} ],
"userSays" : [ "...", "..." ],
"responses" : [ "...", "..." ],
"topicIn" : "...",
"topicOut" : "...",
"webHook" : {
"aiid" : "...",
"intentName" : "...",
"enabled" : true,
"endpoint" : "..."
},
"contextIn" : {
"property1" : "...",
"property2" : "..."
},
"contextOut" : {
"property1" : "...",
"property2" : "..."
},
"conditionsIn" : [ {
"variable" : "...",
"value" : "...",
"operator" : "NOT_SET"
}, {
"variable" : "...",
"value" : "...",
"operator" : "SMALLER_THAN_OR_EQUALS"
} ],
"conditionsFallthroughMessage" : "...",
"resetContextOnExit" : true,
"intentOutConditionals" : [ {
"conditions" : [ { }, { } ],
"intentName" : "..."
}, {
"conditions" : [ { }, { } ],
"intentName" : "..."
} ],
"aiid" : "...",
"status" : {
"code" : 12345,
"success" : { },
"info" : "...",
"created" : { }
}
} ],
"trainingFile" : "...",
"entities" : {
"property1" : {
"entityName" : "...",
"entityValueList" : [ "...", "..." ],
"system" : true,
"devOwner" : "...",
"entityValueType" : "LIST",
"status" : {
"code" : 12345,
"success" : { },
"info" : "...",
"created" : { }
}
},
"property2" : {
"entityName" : "...",
"entityValueList" : [ "...", "..." ],
"system" : true,
"devOwner" : "...",
"entityValueType" : "LIST",
"status" : {
"code" : 12345,
"success" : { },
"info" : "...",
"created" : { }
}
}
},
"version" : 12345,
"private" : true,
"personality" : 12345,
"confidence" : 12345.0,
"voice" : 12345,
"language" : "...",
"timezone" : "...",
"defaultResponses" : [ "...", "..." ],
"passthroughUrl" : "...",
"linkedSkills" : [ 12345, 12345 ],
"handoverResetTimeoutSeconds" : 12345,
"errorThresholdHandover" : 12345,
"handoverMessage" : "..."}

Response

HTTP/1.1 201 Created
Content-Type: application/json


How did we do?