Review Analysis API

Review Analysis API identifies recurring themes and topics in comments and reviews, allows retailers to understand how their customers feel without having to read every review individually.

API Server

nlu-api.allganize.ai is Allganize's NLU API endpoint. If you are using on-prem, please use your API endpoint.

Getting API KEY

The NLU API uses API keys to authenticate requests that you can find in the Allganize NLU API dashboard. Go to Settings > General to find your API key. If you don't have an account yet, you can create one here.

Provide your API KEY in the request header API-KEY.

Review Analysis API

POST https://nlu-api.allganize.ai/api/inference

Headers

Request Body

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

Request Example

Please replace YOUR_API_KEY with your one in the example below. Please see getting-api-key section.

curl https://nlu-api.allganize.ai/api/inference \
-d '{"text": "Cannot recommend highly enough! Absolutely fantastic apartment in a fantastic area! Great thoughtful touches and close amenities! Good vibes all round!"}' \
-H "Content-Type: application/json" \
-H "API-KEY: YOUR_API_KEY" 

Response Example

{
  "inputText": "Cannot recommend highly enough! Absolutely fantastic apartment in a fantastic area! Great thoughtful touches and close amenities! Good vibes all round!"
  "reviewSentiments": [
    {"category": "location", "sentiment": "2", "keywords": [{"text": "in a fantastic area","index": 63}]},
    {"category": "rooms", "sentiment": “3”, “keywords": [{"text": “Absolutely fantastic apart”ment, ”index": 32}]},
    {"category": "service", "sentiment": “1”, "keywords": [{"text": “Great thoughtful touches”, ”index": 84}]}
  ]
}

Error Messages

Please read the error message you get if you don't get the response that you expected.

Error Response example

{
    "type": "APIError",
    "code": 7000,
    "message": "Something went wrong."
}

Last updated