Sets the specified evaluation format to the specified project.

Endpoint

POST http(s)://hostname/api/project/evalformat

Request

Header fields
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 parameters Type Value
id string Required. The project id.

type {binary,scale,ranking,tree} Required. Specify the evaluation format.

requiref {0,1} Optional. 1 to include reference; 0 otherwise.

The following table describes the evaluation format configuration for each format. The configuration is specified using a JSON structure passed as request content.

Request content Type Value
binary JSON Used to evaluation on a scale of 2 levels:
[{
	"color": "The Hex color code of the first level",
	"label": "The string label of the first level",
	"val": 1
}, {
	"color": "The Hex color code of the second level",
	"label": "The string label of the second level",
	"val": 2
}]


scale JSON Used to evaluation on a scale of n levels, this is an extension of the binary case:
[{
	"color": "The Hex color code of the first level",
	"label": "The string label of the first level",
	"val": 1
}, {
	"color": "The Hex color code of the second level",
	"label": "The string label of the second level",
	"val": 2
}
...
{
	"color": "The Hex color code of the nth level",
	"label": "The string label of the nth level",
	"val": n
}]




tree JSON Used to evaluate the output based on n questions:
[{"color":"#000000","label":"0","val":0},
{"color":"#000000","label":"1","val":11111},
{"color":"#000000","label":"2","val":11110},
{"color":"#000000","label":"3","val":11113},
{"color":"#000000","label":"4","val":11101},
{"color":"#000000","label":"5","val":11100},
{"color":"#000000","label":"6","val":11103},
{"color":"#000000","label":"7","val":10111},
{"color":"#000000","label":"8","val":10110},
{"color":"#000000","label":"9","val":10113},
{"color":"#000000","label":"10","val":10101},
{"color":"#000000","label":"11","val":10100},
{"color":"#000000","label":"12","val":10103},
{"color":"#000000","label":"13","val":10011},
{"color":"#000000","label":"14","val":10010},
{"color":"#000000","label":"15","val":10013},
{"color":"#000000","label":"16","val":10001},
{"color":"#000000","label":"17","val":10000},
{"color":"#000000","label":"18","val":10003}]

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": {
    "name": "The project name",
    "id": "The project id",
    "link": "The link to the project home page"
  }
}

On error, the header status and description fields contain the error code and message, respectively.

Example

curl -X POST "https://hostname/api/project/evalformat?id=1&type=binary&requiref=1" -H "X-Api-Key: {user access token}" -d '[{"color":"FF8080","label":"bad","val":1},{"color":"99ff99","label":"good","val":2}]'
{
  "header": {
    "date": "Monday, 2016-05-16 11:54:17 Europe/Paris",
    "description": "Sets the specified evaluation format to the specified project.",
    "status": "200"
  },
  "result": {
    "name": "test project",
    "id": 1,
    "link": "https://mtequaldev.fbk.eu/admin?pid=1"
  }
}