Returns the whole corpus imported in the specified project. The output includes the corpus name, file names, TUs, and comments.

Endpoint

GET http(s)://hostname/api/corpus/show

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.

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": {
    "corpus": [
        	"filename": "The file from which the TUs have been imported",
			"errors": "Errors and warning massages received during the import phase",
			"size": "The number of TUs imported",
			"TUs": [{
				"id": "The TU id",
				"sentences": [{
					"num": "The numeric identifier",
					"language": "The text language",
					"type": "The type of text: source, reference or target",
					"text": "The text in the specified language",
					"comment": "The text comment",
					"updated": "Date and time of the text has been imported"
				}, {
				...
    }
  }
}

Example

curl -X POST "https://hostname/api/corpus/show?id=1" -H "X-Api-Key: {user access token}"
{
	"header": {
		"date": "Thursday, 2016-06-09 16:32:40 Europe\/Paris",
		"description": "Returns the whole corpus imported in the specified project. The output includes the corpus name, file names, TUs, and comments.",
		"status": "200"
	},
	"result": {
		"corpus": [{
			"filename": "input-complete1.csv",
			"errors": "",
			"size": 1,
			"TUs": [{
				"id": "2",
				"sentences": [{
						"num": 61,
						"language": "it",
						"type": "source",
						"text": "Mi piace NY",
						"comment": "global com1",
						"updated": "Thursday, 2016-06-09 16:31:52 Europe\/Paris"

					}, {
						"num": 64,
						"language": "en",
						"type": "sys1",
						"text": "I like NY",
						"comment": "Sys 1 comment",
						"updated": "Thursday, 2016-06-09 16:31:52 Europe\/Paris"
					}

				]
			}]
		}]
	}
}