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 a list of feedback items;
- get incident feedback item by id;
- get feedback request statistics.
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 --request POST \
--url https://api.inten.to/feedback \
--header 'Content-Type: application/json' \
--header 'apikey: <YOUR_API_KEY>' \
--data '{
"comment": "example comment text",
"source": "en",
"source_text": "example source text",
"target": "de",
"target_text": "example target text",
"translation_rating": 3,
"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": 1658750913,
"external_id": "123456",
"feedback_source": "source_1",
"id": 68641,
"lang_pair": "en-de",
"latest_translation": null,
"license_id": 113,
"source": "en",
"source_text": "example source text",
"status": "new",
"suggested_translation": "example suggested translation",
"target": "de",
"target_text": "example target text",
"third_party_id": null,
"translation_rating": 3.0,
"updated_at": 1658750913,
"updated_translation_rating": null
}
Get a list of feedback items.
You may retrieve a list of Feedback items to check that incident feedback was uploaded successfully. 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:
[
{
"id": 38,
"created_at": "2022-07-25T12:28:04.193Z",
"updated_at": "2022-07-25T12:28:04.193Z",
"lang_pair": "en-de",
"target": "de",
"source": "en",
"translation_rating": 3,
"external_id": "3",
"client_id": "6b5fe585-951e-4f52-8c0e-a589435d2f52",
"updated_translation_rating": null,
"status": "new",
"feedback_source": "source_1",
"third_party_id": null,
"comment": "example comment text 3",
"source_text": "example source text 3",
"target_text": "example target text 3",
"suggested_translation": "example suggested translation 3",
"latest_translation": null
},
{
"id": 36,
"created_at": "2022-07-25T12:27:44.764Z",
"updated_at": "2022-07-25T12:27:44.764Z",
"lang_pair": "en-de",
"target": "de",
"source": "en",
"translation_rating": 3,
"external_id": "1",
"client_id": "6b5fe585-951e-4f52-8c0e-a589435d2f52",
"updated_translation_rating": null,
"status": "new",
"feedback_source": "source_1",
"third_party_id": null,
"comment": "example comment text 1",
"source_text": "example source text 1",
"target_text": "example target text 1",
"suggested_translation": "example suggested translation 1",
"latest_translation": null
},
{
"id": 37,
"created_at": "2022-07-25T12:27:54.298Z",
"updated_at": "2022-07-25T12:27:54.298Z",
"lang_pair": "en-de",
"target": "de",
"source": "en",
"translation_rating": 3,
"external_id": "2",
"client_id": "6b5fe585-951e-4f52-8c0e-a589435d2f52",
"updated_translation_rating": null,
"status": "new",
"feedback_source": "source_1",
"third_party_id": null,
"comment": "example comment text 2",
"source_text": "example source text 2",
"target_text": "example target text 2",
"suggested_translation": "example suggested translation 2",
"latest_translation": null
}
]
Get incident item by id.
To check that an incident was uploaded successfully or to get an incident feedback item by id, send a GET request with <FEEDBACK_ID> in numeric format (for example, “id”: 9000 in sample POST request above) and Intento API key.
GET request:
curl --request GET \
--url https://api.inten.to/feedback/<FEEDBACK_ID> \
--header 'apikey: <YOUR_API_KEY>'
API response:
{
"comment": "example comment text",
"created_at": 1658750913,
"external_id": "123456",
"feedback_source": "source_1",
"id": 68641,
"lang_pair": "en-de",
"latest_translation": null,
"license_id": 113,
"source": "en",
"source_text": "example source text",
"status": "new",
"suggested_translation": "example suggested translation",
"target": "de",
"target_text": "example target text",
"third_party_id": null,
"translation_rating": 3.0,
"updated_at": 1658750913,
"updated_translation_rating": null
}
Additional request parameters
In the current version of API, you can:
-
Entities limit per page -
limit
-
Get a specific page -
page
-
Query filter -
s
For example:
-
Get entities limited by 2 per page and show page 12
GET request
curl --request GET \
--url 'https://api.inten.to/feedback?limit=2&page=12' \
--header 'apikey: <YOUR_API_KEY>'
API response
{
"data": [
{
"id": 55,
"created_at": "2022-07-29T07:47:31.758Z",
"updated_at": "2022-07-29T07:47:31.758Z",
"lang_pair": "en-de",
"target": "de",
"source": "en",
"translation_rating": 3,
"external_id": "4",
"client_id": "b8e0f3ee-a872-481b-be72-ce7802cc0308",
"updated_translation_rating": null,
"status": "new",
"feedback_source": "source_2",
"third_party_id": null,
"comment": "example comment text 7",
"source_text": "example source text 7",
"target_text": "example target text 7",
"suggested_translation": "example suggested translation 7",
"latest_translation": null
},
{
"id": 54,
"created_at": "2022-07-29T07:46:11.334Z",
"updated_at": "2022-07-29T07:46:11.334Z",
"lang_pair": "en-de",
"target": "de",
"source": "en",
"translation_rating": 3,
"external_id": "4",
"client_id": "b8e0f3ee-a872-481b-be72-ce7802cc0308",
"updated_translation_rating": null,
"status": "new",
"feedback_source": "source_2",
"third_party_id": null,
"comment": "example comment text 6",
"source_text": "example source text 6",
"target_text": "example target text 6",
"suggested_translation": "example suggested translation 6",
"latest_translation": null
}
],
"count": 2,
"total": 29,
"page": 12,
"pageCount": 15
}
Query filter
You can use a query filter to customize API responses.
For example:
-
Search for an entity where
external_id
is equal to2
GET request:
curl --request GET \
--url 'https://api.inten.to/feedback?s={"external_id": {"$eq": "2"}}' \
--header 'apikey: <YOUR_API_KEY>'
API response
{
"data": [
{
"id": 68643,
"created_at": "2022-07-25T12:20:21.000Z",
"updated_at": "2022-07-25T12:20:21.000Z",
"lang_pair": "en-de",
"target": "de",
"source": "en",
"translation_rating": 3,
"external_id": "2",
"client_id": "b8e0f3ee-a872-481b-be72-ce7802cc0308",
"updated_translation_rating": null,
"status": "new",
"feedback_source": "source_1",
"third_party_id": null,
"comment": "example comment text 2",
"source_text": "example source text 2",
"target_text": "example target text 2",
"suggested_translation": "example suggested translation 2",
"latest_translation": null
}
],
"count": 1,
"total": 1,
"page": 1,
"pageCount": 1
}
Documentation about query filter parameters specified here Requests · nestjsx/crud Wiki.
Get feedback request statistics.
To get feedback request statistics, you can send a GET request with the 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.