[POST] .../v1/ticket/setclientsentiment
Sets an operator client sentiment score for a closed CRM ticket. Use this method when the responsible operator evaluates the client's sentiment after a ticket is closed. The method requires the extended CRM ticket schema, validates the closed ticket, responsible-operator ownership, 1.5 sentiment score range and one-time sentiment rule, saves score/comment/user/date, recalculates aggregated client sentiment, writes an action log record, sends TicketClientSentimentSet webhook and returns row_affected with the ticket id. The request body is required; id must be positive, sentiment_score must be from 1 to 5, the current request user must be the ticket responsible user and sentiment cannot be changed after it has already been set. The caller must have CRM ticket client-sentiment permission; missing body, invalid id or score, unsupported database schema, missing ticket, non-closed ticket status, non-responsible current user, already-set sentiment, client sentiment recalculation errors, database errors, transaction failures and action-log errors are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | Int64 | Required | Ticket ID. |
| sentiment_comment | String | Optional | Client sentiment score comment. |
| sentiment_score | Int32 | Required | Client sentiment score in the 1.5 range. |
Request Example
{
"id": 610,
"sentiment_score": 4,
"sentiment_comment": "Client is satisfied but waiting for delivery"
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Update | Update operation result. |
Response Example
{
"ok": true,
"result": {
"row_affected": 1,
"ids": [
610
]
}
}