Get Conversation Property
Get Conversation Property
Retrieve the conversation-level property list using the conversation_id parameter, including the conversation property name, type, and the current conversation's value. All conversation properties defined on the Agent are returned; if a property has not been assigned a value in the current conversation, value falls back to the property's defined default value.
Request Method
GET
Endpoint
https://api-${endpoint}.gptbots.ai/v1/conversation/property
Authentication
Refer to API Overview for authentication instructions.
Request
Example Request
curl -X GET 'https://api-${endpoint}.gptbots.ai/v1/conversation/property?conversation_id=6a55ff78f847452309cae7d4' \
-H 'Authorization: Bearer ${API Key}'
curl -X GET 'https://api-${endpoint}.gptbots.ai/v1/conversation/property?conversation_id=6a55ff78f847452309cae7d4' \
-H 'Authorization: Bearer ${API Key}'
This code block in the floating window
Request Headers
| Field | Type | Description |
|---|---|---|
| Authorization | Bearer ${API Key} | Use Authorization: Bearer ${API Key} for authentication. Obtain your API key from the API Key page. |
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| conversation_id | string | Yes | Conversation identifier. |
Response
Example Response
[
{
"id": "66aa1b2c3d4e5f60718293a4",
"name": "vip_level",
"type": "INTEGER",
"value": "3"
},
{
"id": "66aa1b2c3d4e5f60718293a5",
"name": "user_city",
"type": "STRING",
"value": "Bangkok"
},
{
"id": "66aa1b2c3d4e5f60718293a6",
"name": "is_member",
"type": "BOOLEAN",
"value": "true"
}
]
[
{
"id": "66aa1b2c3d4e5f60718293a4",
"name": "vip_level",
"type": "INTEGER",
"value": "3"
},
{
"id": "66aa1b2c3d4e5f60718293a5",
"name": "user_city",
"type": "STRING",
"value": "Bangkok"
},
{
"id": "66aa1b2c3d4e5f60718293a6",
"name": "is_member",
"type": "BOOLEAN",
"value": "true"
}
]
This code block in the floating window
Successful Response
| Field | Type | Description |
|---|---|---|
| id | string | Unique identifier of the conversation property definition. |
| name | string | Conversation property name. |
| type | string | Conversation property type, values: STRING, INTEGER, NUMBER, BOOLEAN, DATETIME. |
| value | string | Conversation property value, always returned as a string (DATETIME as an epoch-millisecond string, BOOLEAN as "true"/"false"). If the property has been assigned a value in the current conversation, the conversation value is returned; otherwise the property's defined default value is returned. |
Error Response
| Field | Type | Description |
|---|---|---|
| code | int | Error code. |
| message | string | Error details. |
Error Codes
| Code | Message |
|---|---|
| 40000 | Invalid parameters |
| 40127 | Developer authentication failed |
| 40356 | Conversation does not exist |
| 20059 | Agent has been deleted |
