# Review Analysis API

## API Server

AllganizeのAPIエンドポイントは[nlu-api.allganize.ai](https://nlu-api.allganize.ai)です。On-premプランのご利用の場合は、ご希望のAPIエンドポイントを使用してください。

## APIキーの取得

すべてのNLU APIは、リクエストを検証するためにAPIキーを使用しています。APIキーは[NLU APIのプロジェクト設定メニュー](https://nlu.allganize.ai/projects)から確認できます。NLU APIダッシュボードのアカウントがない場合は、[こちら](https://nlu.allganize.ai/signup)から生成してください。

#### &#x20;Requestヘッダーの`API-KEY` に割り当てられた`API KEY` を入力してください。

## Review Conversion API

<mark style="color:green;">`POST`</mark> `https://nlu-api.allganize.ai/api/inference`

#### Headers

| Name    | Type   | Description                               |
| ------- | ------ | ----------------------------------------- |
| API-KEY | string | 割り当てられたAPIキーです。プロジェクト設定メニュー>一般タブから確認できます。 |

#### Request Body

| Name | Type   | Description                                             |
| ---- | ------ | ------------------------------------------------------- |
| text | string | 分析対象のテキストです。最大2000文字まで入力できます。2000文字以降の内容は自動で入力・分析されません。 |

{% tabs %}
{% tab title="200" %}
Responseには各カテゴリの顧客評価情報が含まれています。

category: 顧客評価のカテゴリです。カテゴリはNLU APIのダッシュボードから定義することができます。

sentiment: 各カテゴリの評価情報で、数字で表示されます。それぞれの数字の評価指標を定義するためには、Allganizeの担当者にお問い合わせください。

```
{
  "inputText": STRING,
  "reviewSentiments": [
    {
      "category": STRING,
      "sentiment": STRING,
    }, ...
  ]
}
```

{% endtab %}
{% endtabs %}

### Request Example

YOUR API KEYをプロジェクトのAPIキーに変更しなければなりません。[APIキーの取得](https://docs.allganize.ai/v/ja/review-conversion-api#apikno)の項目をご参照ください。

```
curl https://nlu-api.allganize.ai/api/inference \
-d '{"text": "誰にも教えたくないくらいでした！位置もいいし、きれいだし、近くのレストランも大満足です。部屋のインテリア小物もおしゃれでよかったです!"}' \
-H "Content-Type: application/json" \
-H "API-KEY: YOUR_API_KEY"
```

### Response Example

```
{
  "inputText": "誰にも教えたくないくらいでした！位置もいいし、きれいだし、近くのレストランも大満足です。部屋のインテリア小物もおしゃれでよかったです!"
  "reviewSentiments": [
    { "category": "位置", "sentiment": "4" },
    { "category": "清潔", "sentiment": "4" },
    { "category": "部屋", "sentiment": "3" },
    { "category": "寝具", "sentiment": "0" },
    { "category": "サービス", "sentiment": "0" }
  ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.allganize.ai/api-reference/ja-1/review-conversion-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
