GET /traits/values
List values for the traits in the `?only=` query parameter

GET /traits/:trait/values
List values for a particular trait. `:trait` can be a trait key or ID

Examples

"pagination": {
  "per_page": 25,
  "total_pages": 6,
  "total_objects": 135
},
"trait_values": [
  {
    "id": 1,
    "column_name": "body_shape",
    "column_value": "Round Body (Rhumba)",
    "description": "None provided.",
    "approved": true,
    "image": {
      "thumb": "http://s3.amazonaws.com/eb-api-images/images/files/000/000/416/thumb/01.jpg?1451585446",
      "small": "http://s3.amazonaws.com/eb-api-images/images/files/000/000/416/small/01.jpg?1451585446",
      "medium": "http://s3.amazonaws.com/eb-api-images/images/files/000/000/416/medium/01.jpg?1451585446",
      "large": "http://s3.amazonaws.com/eb-api-images/images/files/000/000/416/large/01.jpg?1451585446",
      "original": "http://s3.amazonaws.com/eb-api-images/images/files/000/000/416/original/01.jpg?1451585446"
    }
  },
  {
    "id": 2,
    "column_name": "body_shape",
    "column_value": "Rect (Bo Diddley)",
    "description": "None provided.",
    "approved": true,
    "image": {
      "thumb": "http://s3.amazonaws.com/eb-api-images/images/files/000/000/767/thumb/Bo_diddley.jpg?1453227527",
      "small": "http://s3.amazonaws.com/eb-api-images/images/files/000/000/767/small/Bo_diddley.jpg?1453227527",
      "medium": "http://s3.amazonaws.com/eb-api-images/images/files/000/000/767/medium/Bo_diddley.jpg?1453227527",
      "large": "http://s3.amazonaws.com/eb-api-images/images/files/000/000/767/large/Bo_diddley.jpg?1453227527",
      "original": "http://s3.amazonaws.com/eb-api-images/images/files/000/000/767/original/Bo_diddley.jpg?1453227527"
    }
  }
  ...
]
        

Params

Param name Description
page
optional

Value:

Must be Integer.

per_page
optional

Value:

Must be Integer.

only
optional

An optional set of comma-separated trait column names. When you pass a specific set of column names (eg: `?column_name=fingerboard_inlay,neck_binding`), the JSON response is an object with an array of results for each requested column name.


Value:

Must be String

in_use
optional

Value:

Must be true or false.

approved
optional

Value:

Must be true or false.

pending
optional

Value:

Must be true or false.


GET /traits/:trait/values/:id
Show a trait value


POST /traits/:trait/values
Create a trait value

Errors

400

Examples

curl -X POST -H "Content-Type: application/json" -d '{"column_name": "number_of_strings", "column_value": "100", "description": "100 strings!"}' -H "Authorization: XXXX" http://localhost:3000/traits/number_of_strings/values

{
	"trait_value": {
		"id": 5634,
		"column_name": "number_of_strings",
		"column_value": "100",
		"description": "100 strings!",
		"approved": false,
		"image": null
	}
}
        

Params

Param name Description
name
optional

Value:

Must be String

column_value
optional

Value:

Must be String

description
optional

An optional description


Value:

Must be String


PUT /traits/:trait/values/:id
Update a trait value

Errors

400

Params

Param name Description
name
optional

Value:

Must be String

column_value
optional

Value:

Must be String

description
optional

An optional description


Value:

Must be String


DELETE /traits/:trait/values/:id
Destroy a trait value