> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.omicx.one/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.omicx.one/_mcp/server.

# Tìm bản mẫu đánh giá

POST https://api.omicx.one/feedbacks/templates/search
Content-Type: application/json

**Scope yêu cầu:** `customer:read`, agent cần quyền `config.feedback-template` → view. Trả về phiên bản **published** của mỗi bản mẫu, mới nhất trước. Body rỗng = trang 1.

Reference: https://developers.omicx.one/feedbacks/search-feedback-templates

## Request

### Headers

- `X-Api-Key` (string, required)

### Body (application/json)

This endpoint expects a FeedbackTemplateSearchRequest.

- `page` (integer, optional, default: 1)
- `size` (integer, optional, default: 20)

## Response

### 200

Một trang bản mẫu đánh giá.

- `items` (list of FeedbackTemplatePageItemsItems, optional)
- `page` (integer, optional)
- `size` (integer, optional)
- `totalItems` (long, optional)
- `totalPages` (integer, optional)

## Errors

### 401 Unauthorized Error

`API_KEY_REQUIRED` hoặc `API_KEY_INVALID`.

- `error` (ErrorResponseError, optional)

### 403 Forbidden Error

`INSUFFICIENT_SCOPE` · `API_KEY_PRINCIPAL_REQUIRED` · `API_KEY_PRINCIPAL_NOT_ELIGIBLE` · `FEATURE_ACCESS_DENIED`.

- `error` (ErrorResponseError, optional)

### 429 Too Many Requests Error

`RATE_LIMIT_EXCEEDED`.

- `error` (ErrorResponseError, optional)

### 502 Bad Gateway Error

`CUSTOMER_SERVICE_UNAVAILABLE`, kèm `Retry-After: 5`.

- `error` (ErrorResponseError, optional)

## Types

### FeedbackTemplatePageItemsItems

Có cùng hình dạng với phần `rating`/`content` mà `POST /feedbacks/submit` cần gửi lên để trả lời bản mẫu này.

- `templateId` (string, optional)
- `name` (string, optional)
- `description` (string, optional, nullable)
- `metadata` (map from string to any, optional, nullable) — Object tự do do web app lưu trên bản mẫu.
- `rating` (FeedbackTemplateRatingDefinition, optional) — Trả lời bằng `rating` — `score` là một `levels[].score`; `selectedOptions` lấy nhãn từ `followUp.options` của đúng mức điểm đó.
- `content` (map from string to FeedbackTemplateContentFieldDefinition, optional) — Khoá theo component id — cùng khoá mà `content` của submit sẽ mang. Tất cả đều tuỳ chọn.

### ErrorResponseError

- `code` (string, optional) — Nhóm lỗi (dạng máy đọc được), ổn định theo từng HTTP status.
- `subCode` (string, optional, nullable) — Mã cụ thể, ổn định — dùng để phân nhánh xử lý / dịch i18n. Hãy xử lý logic dựa trên `subCode`, không dựa vào chuỗi `message`.
- `message` (string, optional) — Mô tả cho con người đọc (dùng để debug), không nên dịch trực tiếp.
- `timestamp` (long, optional) — Epoch millis.
- `path` (string, optional) — Đường dẫn request đầy đủ.
- `traceId` (string, optional, nullable)
- `details` (list of ErrorResponseErrorDetailsItems, optional, nullable)

### FeedbackTemplateRatingDefinition

Trả lời bằng `rating` — `score` là một `levels[].score`; `selectedOptions` lấy nhãn từ `followUp.options` của đúng mức điểm đó.

- `title` (string, optional)
- `description` (string, optional, nullable)
- `icon` (enum, optional)
  - Allowed values: `STAR`
- `levels` (list of FeedbackTemplateRatingDefinitionLevelsItems, optional)

### FeedbackTemplateContentFieldDefinition

- `type` (enum, optional)
  - Allowed values: `SHORT_TEXT`, `LONG_TEXT`, `SINGLE_SELECT`, `MULTI_SELECT`
- `title` (string, optional)
- `settings` (FeedbackTemplateContentFieldDefinitionSettings, optional)
- `options` (list of string, optional) — Chỉ có ở component dạng lựa chọn — các nhãn (label) lựa chọn.

### ErrorResponseErrorDetailsItems

- `field` (string, optional)
- `message` (string, optional)
- `rejectedValue` (any, optional, nullable)

### FeedbackTemplateRatingDefinitionLevelsItems

- `score` (integer, optional)
- `label` (string, optional)
- `followUp` (FeedbackTemplateRatingDefinitionLevelsItemsFollowUp, optional, nullable) — Chỉ có khi mức điểm này cần hỏi thêm.

### FeedbackTemplateContentFieldDefinitionSettings

- `placeholder` (string, optional, nullable)
- `helperText` (string, optional, nullable)
- `maxLength` (integer, optional, nullable) — Chỉ áp dụng cho component dạng văn bản; `null` = giới hạn mặc định của kiểu đó.

### FeedbackTemplateRatingDefinitionLevelsItemsFollowUp

Chỉ có khi mức điểm này cần hỏi thêm.

- `id` (string, optional)
- `title` (string, optional)
- `selectionType` (enum, optional)
  - Allowed values: `SINGLE`, `MULTIPLE`
- `required` (boolean, optional)
- `options` (list of string, optional)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "items": [
    {
      "templateId": "762368",
      "name": "Khảo sát sau cuộc gọi",
      "rating": {
        "title": "Bạn hài lòng chứ?",
        "icon": "STAR",
        "levels": [
          {
            "score": 2,
            "label": "Chưa tốt",
            "followUp": {
              "id": "f2",
              "title": "Vì sao?",
              "selectionType": "MULTIPLE",
              "required": false,
              "options": [
                "Hỗ trợ chậm"
              ]
            }
          }
        ]
      },
      "content": {
        "comment": {
          "type": "LONG_TEXT",
          "title": "Góp ý",
          "settings": {
            "maxLength": 2000
          },
          "options": []
        },
        "nhieuluachon": {
          "type": "MULTI_SELECT",
          "title": "Chọn",
          "settings": {},
          "options": [
            "asd",
            "123"
          ]
        }
      }
    }
  ],
  "page": 1,
  "size": 20,
  "totalItems": 1,
  "totalPages": 1
}
```

**SDK Code**

```python default
import requests

url = "https://api.omicx.one/feedbacks/templates/search"

payload = {}
headers = {
    "X-Api-Key": "omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript default
const url = 'https://api.omicx.one/feedbacks/templates/search';
const options = {
  method: 'POST',
  headers: {
    'X-Api-Key': 'omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
    'Content-Type': 'application/json'
  },
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go default
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.omicx.one/feedbacks/templates/search"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-Api-Key", "omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby default
require 'uri'
require 'net/http'

url = URI("https://api.omicx.one/feedbacks/templates/search")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = 'omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java default
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.omicx.one/feedbacks/templates/search")
  .header("X-Api-Key", "omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php default
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.omicx.one/feedbacks/templates/search', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Api-Key' => 'omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  ],
]);

echo $response->getBody();
```

```csharp default
using RestSharp;

var client = new RestClient("https://api.omicx.one/feedbacks/templates/search");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Api-Key", "omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift default
import Foundation

let headers = [
  "X-Api-Key": "omx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.omicx.one/feedbacks/templates/search")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```