GET /artifacts/:id
The artifact representation sent in GET request will have an additional field in order to easily retrieve values:
GET /artifacts/:id?…
200 Ok
<response>
<id>42</id>
...
<values>
<item>
<field_id>12</field_id>
<type>float</type>
<name>story_points</name>
<label>Story Points</label>
<value>1.6</value>
</item>
</values>
<values_by_field>
<story_point>1.6</story_point>
</values_by_field>
</response>
In order to not clutter to much the response, one can ask for a specific value format:
GET /artifcats/:id?values_format=flat_array # only flat array of values is returned (as of today)
GET /artifcats/:id?values_format=by_field # only values indexed by field are returned
GET /artifcats/:id?values_format=all # like in the example above
If values_format is ommitted then we consider that values_format = flat_array
POST /artifacts/:id
The route will accept two formats of values to create an artifact.
POST /artifacts/:id
<artifact>
<values>
<item>
<field_id>12</field_id>
<value>3.14</value>
</item>
</values>
</artifact>
200 Ok
Or
POST /artifacts/:id
<artifact>
<values_by_field>
<story_points>3.14</story_points>
</values_by_field>
</artifact>
200 Ok
If both format are submitted we will raise an Exception as we cannot handle both format at a time (400 Bad Request). If the submitted value does not correspond to the expected type then 400 Bad Request will be raised as well.
The POST request will handle only alphanumeric fields (no need to work with complex fields like list field as of today).
POST response (201 created) should return the parametrized url.