A customer attribute is a specially created field in the agent panel that stores information about the customer. The contents of customer attributes are displayed in the agent panel under the About the Customer section. Customer attributes can be used for various purposes, but their main purpose is to provide the agent with necessary information about the customer. This approach helps improve the quality of interaction between the client and the operator.
Each attribute is created using a separate request.
Method: POST
Authorization: Bearer Token
URL: https://chat-api.twin24.ai/api/v1/clients/attributes
curl --location ‘https://chat-api.twin24.ai/api/v1/clients/attributes’ \
--header ‘accept: application/json’ \
--header ‘content-type: application/json’ \
--header ‘Authorization: Bearer TOKEN’ \
--data '{“name”:“Client Name”}'
{
“name”:“Client Name”
}
| Parameter | Description |
|---|---|
| name | Sets the name for the attribute |
{
“id”: “bf1fee...70dc544”
}
| Parameter | Description |
|---|---|
| id | Identifier of the created attribute |
In the operator panel, under the About the Client section, an editable Client Name field will appear. The field’s value can be viewed and edited from the operator panel and via the API.
Method: GET
Authorization: Bearer Token
URL: https://chat-api.twin24.ai/api/v1/clients/attributes
curl --location ‘https://chat-api.twin24.ai/api/v1/clients/attributes’ \
--header ‘accept: application/json’ \
--header ‘Authorization: Bearer TOKEN’
{
“count”: 3,
“items”: [
{
“id”: “bf1fee...70dc544”,
“companyId”: 123,
“name”: “Client Name”
},
{
“id”: “bf1fee...70dc544”,
“companyId”: 123,
“name”: “Age”
},
{
“id”: “bf1fee...70dc544”,
“companyId”: 123,
“name”: “Subject”
}
]
}
| Parameter | Description |
|---|---|
| count | Total number of attributes |
| items | Array[Object] |
| id | Attribute ID |
| companyId | Company ID |
| name | Attribute name |
Method: POST
Authorization: Bearer Token
URL: https://chat-api.twin24.ai/api/v1/clients/{CLIENT_ID}/attributes/{ATTRIBUTE_ID}
curl --location ‘https://chat-api.twin24.ai/api/v1/clients/{CLIENT_ID}/attributes/{ATTRIBUTE_ID}’ \
--header ‘accept: application/json’ \
--header ‘content-type: application/json’ \
--header ‘Authorization: Bearer TOKEN’ \
--data ‘{“value”:“NAME”}’
{
“value”:“Name”
}
If the request is successful, a response with a 200 status code and no body is returned.
Method: GET
Authorization: Bearer Token
URL: https://chat-api.twin24.ai/api/v1/clients/{CLIENT_ID}/attributes
curl --location ‘https://chat-api.twin24.ai/api/v1/clients/{CLIENT_ID}/attributes’ \
--header ‘accept: application/json’ \
--header 'Authorization: Bearer TOKEN'
{
“count”: 1,
“items”: [
{
“id”: “0c1f0-...-9dc052045452”,
“clientId”: "35e45a67-... -9dc052045452",
“companyId”: 123,
“name”: “Client Name”,
“value”: “Ivan”
}
]
}
| Parameter | Description |
|---|---|
| count | Total number of attributes |
| items | Array[Object] |
| | id | Attribute ID |
| | clientId | Client ID |
| | companyId | Company ID |
| | name | Attribute name |
| | value | Attribute value |
Method: DELETE
Authorization: Bearer Token
URL: https://chat-api.twin24.ai/api/v1/clients/attributes/{ATTRIBUTE_ID}
This method will delete the attribute from the user’s personal account. After deletion, the attribute will no longer be displayed in the About the Client section.
curl --location --request DELETE ‘https://chat-api.twin24.ai/api/v1/clients/attributes/{ATTRIBUTE_ID}’ \
--header ‘accept: application/json’ \
--header ‘Authorization: Bearer TOKEN’
If the method is executed successfully, a response with a 200 status code and no body will be returned.
Method: DELETE
Authorization: Bearer Token
URL: https://chat-api.twin24.ai/api/v1/clients/{CLIENT_ID}/attributes/{ATTRIBUTE_ID}
curl --request DELETE \
--location ‘https://chat-api.twin24.ai/api/v1/clients/{CLIENT_ID}/attributes/{ATTRIBUTE_ID}’ \
--header ‘accept: application/json’ \
--header 'authorization: Bearer TOKEN'
If the method is executed successfully, a response with a 200 status code and no body will be returned.
Method: PATCH
Authorization: Bearer Token
URL: https://chat-api.twin24.ai/api/v1/clients/attributes
curl --request PATCH \
--location ‘https://chat-api.twin24.ai/api/v1/clients/attributes/{ATTRIBUTE_ID}’\
--header ‘accept: application/json’ \
--header ‘authorization: Bearer TOKEN’ \
--header ‘content-type: application/json’ \
--data ‘{“name”:“Client Response”}’
{
“name”:“Client response”
}
| Parameter | Description |
|---|---|
| name | New attribute name |
If the method is executed successfully, a response with a 200 status code and no body will be returned.