Feedback API
To start using the Feedback interface, you can upload translation incidents feedback for review via the Feedback API.
In the current version of API you can:
- push new incident feedback for review;
- get incident feedback item by id.
See sample API requests below.
Adding new incident feedback
To upload a new incident feedback item you should send a POST request to https://api.inten.to/feedback/ with the Intento API key. All fields are optional.
POST request:
curl -X POST \
https://api.inten.to/feedback/ \
-H 'Content-Type: application/json' \
-H 'Host: api.inten.to' \
-H 'apikey: <YOUR_API_KEY>' \
-d '{
"comment": "example comment text",
"source": "cs",
"source_text": "example source text",
"target": "en",
"target_text": "example target text",
"translation_rating": 2,
"suggested_translation": "example suggested translation",
"external_id": "123456",
"feedback_source": “source_1”
}'
Expected values for translation_rating field:
0 | Not understandable |
1 | Hardly understandable |
2 | Understandable |
3 | Good |
API response:
{
"comment": "example comment text",
"created_at": 1567699693,
"external_id": null,
"id": 9000,
"lang_pair": "cs-en",
"latest_translation": null,
"source": "cs",
"source_text":"example source text",
"suggested_translation": "example suggested translation",
"target": "en",
"target_text": "example target text",
"translation_rating": 2,
"updated_at": 1567699693,
"updated_translation_rating": null,
"feedback_source": “source_1”
}
Get incident item by id
To check that an incident was uploaded successfully or to get an incident feedback item by id, send GET request with <feedback_id> in numeric format (for example, “id”: 9000 in sample POST request above) and Intento API key.
GET request:
curl -X GET\
https://api.inten.to/feedback/<feedback_id> \
-H 'Content-Type: application/json' \
-H 'Host: api.inten.to' \
-H 'apikey: <YOUR_API_KEY>'
API response:
{
"comment": "example comment text",
"created_at": 1567699693,
"external_id": null,
"id": 1,
"lang_pair": "cs-en",
"latest_translation": null,
"source": "cs",
"source_text":"example source text",
"suggested_translation": "example suggested translation",
"target": "en",
"target_text": "example target text",
"translation_rating": 2,
"updated_at": 1567699693,
"updated_translation_rating": null,
"feedback_source": “source_1”
}
Get a list of feedback items
To check that incident feedback was uploaded successfully, you may retrieve a list of Feedback items. To do this, send a GET request with the Intento API key.
GET request:
curl -X GET\
https://api.inten.to/feedback \
-H 'Content-Type: application/json' \
-H 'Host: api.inten.to' \
-H 'apikey: <YOUR_API_KEY>'
API response:
{
"num_results": 3,
"objects": [
{
"comment": "comment 1",
"created_at": null,
"id": 1,
"lang_pair": "en-ru",
"latest_translation": null,
"source": "en",
"source_text": "Hello",
"suggested_translation": null,
"target": "ru",
"target_text": "Привет",
"translation_rating": null,
"updatedAt": null,
"updated_translation_rating": null,
"feedback_source": "source_1"
},
{
"comment": "comment 1",
"created_at": null,
"id": 2,
"lang_pair": "en-ru",
"latest_translation": null,
"source": "en",
"source_text": "Hello",
"suggested_translation": "Hola",
"target": "ru",
"target_text": "Привет",
"translation_rating": null,
"updated_at": null,
"updated_translation_rating": null,
"feedback_source": "source_1"
},
{
"comment": "comment 3",
"created_at": 1567699693,
"id": 3,
"lang_pair": "en-ru",
"latest_translation": null,
"source": "en",
"source_text": "Hello",
"suggested_translation": "Aloha",
"target": "ru",
"target_text": "Привет",
"translation_rating": null,
"updatedAt": 1567699693,
"updated_translation_rating": null,
"feedback_source": "source_1"
}
],
"page": 1,
"total_pages": 1
}
Get feedback request statistics
To get feedback request statistics, you can send a GET request with Intento API key with from and to parameters for the date range.
GET request:
curl -X GET\
https://api.inten.to/feedback/statistics?from=2020-01-01&to=2020-02-01 \
-H 'Content-Type: application/json' \
-H 'Host: api.inten.to' \
-H 'apikey: <YOUR_API_KEY>'
API response:
{
"data":
[
{
"num_chars": 547,
"source": "cs",
"target": "en",
"req_count": 1,
"avg_rating": 0.5,
"day": "2019-09-12"
},
{
"num_chars": 12,
"source": "en",
"target": "ja",
"req_count": 2,
"avg_rating": 1.0,
"day": "2019-11-14"
},
{
"num_chars": 6,
"source": "en",
"target": "ru",
"req_count": 1,
"avg_rating": 1.0,
"day": "2019-11-14"
}
]
}
Feedback UI details can be found here.