MT-EQuAl REST API
GET corpus/import
Imports a file in the corpus of the specified project.
Endpoint
GET http(s)://hostname/api/corpus/import
Request Parameters
Header field
|
Type | Value |
---|---|---|
X-Api-Key |
string | Required. A valid access token from a registered MT-EQuAl account. The access
token must have been issued on behalf of the current user. |
Request data | Type | Value |
---|---|---|
id | string | Required. The project id. |
file | string | Required. The pathname string of the file to import. |
Response
On success, the HTTP status code in the response header is 200
(OK)
and the response is structured in JSON as follow:
{
"header": {
"date": "Date and time of the response generation process",
"description": "Description of the invoked method or error message",
"status": "status/error code"
},
"result": {
"id": "The project id",
"filename": "The filename of the input file",
"length": "Number of read characters"
"sentences" : "the number of sentences"
}
}
Example
curl -X POST "https://hostname/api/corpus/import?id=1" -H "Content-Type: multipart/form-data" -H "X-Api-Key: {user access token}" -F "file=@{path of the uploaded file}"
{
"header": {
"date": "Thursday, 2016-06-09 16:32:40 Europe\/Paris",
"description": "Imports a file in the corpus of the specified project.",
"status": "200"
},
"result": {
"id": "1",
"filename": "input-complete1.csv",
"length": 1059,
"sentences" : 4
}