getOrSetState
Retrieves the State object for a valid identifiers. If the state does not exist, it creates a new state.
POST
/v1/chat/states/{type}/{id}/{name}/get-or-setAuthorization
AuthorizationBearerrequiredBearer authentication header of the form Bearer <token>, where <token> is your auth token.
Header parameters
x-bot-idstringrequiredBot id
x-integration-idstringIntegration id
x-integration-aliasstringIntegration alias
Path parameters
typeenum<string>requiredRepresents the resource type that the state is related to
Available options:
"conversation","user","bot","integration","workflow"idstringrequiredId of the State which will be either the botId, the userId or the conversationId
namestringrequiredName of the State which is declared inside the bot definition
Request body
State content
payloadobjectrequiredPayload is the content of the state defined by your bot.
expirynumber | nullExpiry of the State in milliseconds. The state will expire if it is idle for the configured value. By default, a state doesn't expire.(>= 1, <= 2592000000)
Response
Returns the State object if a valid identifiers were provided. Returns an error otherwise.
stateobjectrequiredThe state object represents the current payload. A state is always linked to either a bot, a conversation or a user.
metaobjectrequired