curl --request POST \
--url https://api.botpress.cloud/v1/chat/states/{type}/{id}/{name}/get-or-set \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-bot-id: <x-bot-id>' \
--data '
{
"payload": {},
"expiry": 1296000000.5
}
'{
"state": {
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"botId": "<string>",
"name": "<string>",
"type": "conversation",
"payload": {},
"conversationId": "<string>",
"userId": "<string>"
},
"meta": {
"cached": true
}
}Retrieves the State object for a valid identifiers. If the state does not exist, it creates a new state.
curl --request POST \
--url https://api.botpress.cloud/v1/chat/states/{type}/{id}/{name}/get-or-set \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-bot-id: <x-bot-id>' \
--data '
{
"payload": {},
"expiry": 1296000000.5
}
'{
"state": {
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"botId": "<string>",
"name": "<string>",
"type": "conversation",
"payload": {},
"conversationId": "<string>",
"userId": "<string>"
},
"meta": {
"cached": true
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bot id
Integration id
Integration alias
Represents the resource type that the state is related to
conversation, user, bot, integration, task, 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
State content
The state object represents the current payload. A state is always linked to either a bot, a conversation or a user.
Show child attributes
Payload is the content of the state defined by your bot.
Id of the Conversation
28 - 36Was this page helpful?