Guide
MOI
Initialization
3 min
initializing a session when a shopper starts a chat session the first time, he or she will not have any sessionid assigned to him/her at this time, a message with the klevu api key should be sent to the moi backend if the api key is valid, the backend in its response will return a sessionid for this shopper and a welcome message to be shown to the shopper request { 	"context" { 	 "klevuapikey" "\<store's api key>" 	} } response { "data" \[{ "context" { "sessionid" "\<some session id>", "klevuapikey" "\<store's api key>" } }, { "message" { "id" "6aed823a 1ecc 457a 8d60 d32972408d78", "type" "text", "value" "i am your shopping assistant how can i help you?", "note" null, "explain" null, "collectfeedback" false } }, ] } json response contents the initialization respose contains the following datapoints context true 148 unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type message there can be one or more of this in a single request when rendering messages on the front, please show them in the order they are provided in the response every message has the following members true 148 unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type
