Item Types¶
GET item type¶
Return data about the specified item type.
Request¶
GET /item_types/:id HTTP/1.1
Response¶
{
"id": 1,
"url": "/item_types/1",
"name": "Text",
"description": "A resource consisting primarily of words for reading.",
"elements": [
{
"id": 1,
"url": "http://yourdomain.com/api/elements/1",
"resource": "elements"
},
{
"id": 2,
"url": "http://yourdomain.com/api/elements/2",
"resource": "elements"
},
{
"id": 3,
"url": "http://yourdomain.com/api/elements/3",
"resource": "elements"
}
],
"items": {
"count": 100,
"url": "http://yourdomain.com/api/items?item_type=1",
"resource": "items"
}
}
GET item types¶
Return data about item types.
Response¶
An array of JSON item type representations (see above).
POST item type¶
Create a new item type.
Request¶
POST /item_types HTTP/1.1
{
"name": "Text",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"elements": [
{"id": 1},
{"id": 2},
{"id": 3}
]
}
Response¶
HTTP/1.1 201 Created
Location: http://yourdomain.com/api/item_types/:id
An JSON representation of the newly created item type (see above).