Get Or Set State
Retrieves the [State](#schema_state) object for a valid identifiers. If the state does not exist, it creates a new state.
Path Parameters
Represents the resource type that the state is related to
Value in
- "conversation"
- "user"
- "bot"
- "integration"
- "workflow"
Id of the State which will be either the botId, the userId or the conversationId
Name of the State which is declared inside the bot definition
Header Parameters
Bot id
Integration id
Integration alias
Request Body
application/json
State content
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "https://example.com/v1/chat/states/conversation/string/string/get-or-set" \ -H "x-bot-id: string" \ -H "Content-Type: application/json" \ -d '{ "payload": {} }'{ "state": { "id": "stringstringstringstringstri", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "botId": "stringstringstringstringstri", "conversationId": "stringstringstringstringstri", "userId": "stringstringstringstringstri", "name": "string", "type": "conversation", "payload": {}, "expiry": 1, "expiresAt": "2019-08-24T14:15:22Z" }, "meta": { "cached": true }}{ "state": { "id": "stringstringstringstringstri", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "botId": "stringstringstringstringstri", "conversationId": "stringstringstringstringstri", "userId": "stringstringstringstringstri", "name": "string", "type": "conversation", "payload": {}, "expiry": 1, "expiresAt": "2019-08-24T14:15:22Z" }, "meta": { "cached": true }}Get Or Create User POST
Retrieves the [User](#schema_user) object for given discriminating tags. If the user does not exist, it will be created. If the user already exists, its name, pictureUrl, attributes, and tags will be updated with the provided values.
Get Participant GET
Retrieves a [Participant](#schema_participant) from a [Conversation](#schema_conversation).