botruntime
API ReferenceChat API

Get State

Retrieves the [State](#schema_state) object for a valid identifier.

GET
/v1/chat/states/{type}/{id}/{name}

Path Parameters

type*string

Represents the resource type that the state is related to

Value in

  • "conversation"
  • "user"
  • "bot"
  • "integration"
  • "workflow"
id*string

Id of the State which will be either the botId, the userId or the conversationId

name*string

Name of the State which is declared inside the bot definition

Header Parameters

x-bot-id*string

Bot id

x-integration-id?string

Integration id

x-integration-alias?string

Integration alias

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/chat/states/conversation/string/string" \  -H "x-bot-id: string"
{  "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  }}