-
Notifications
You must be signed in to change notification settings - Fork 194
API : Elements
jimsafley edited this page Jun 26, 2013
·
10 revisions
Return data about the specified element:
GET /elements/:id
{
"id": 1,
"url": "http://yourdomain.com/api/elements/1",
"name": "Text",
"order": 1,
"description": "Any textual data included in the document",
"comment": null,
"element_set": {"id": 1, "url": "http://yourdomain.com/api/element_sets/1"},
}
Return data about elements:
GET /elements
- element_set: integer
- name: string
- item_type: integer
An array of JSON element representations (see above).
Create a new element.
POST /elements
{
"order": 1,
"name": "Foo",
"description": "Foo description.",
"comment": "Foo comment.",
"element_set": {"id": 1}
}
Location: http://yourdomain.com/api/elements/:id
An JSON representation of the newly created element (see above).
Edit an existing element.
PUT /elements/:id
{
"order": 1,
"name": "Foo",
"description": "Foo description.",
"comment": "Foo comment.",
"element_set": {"id": 1}
}
An JSON representation of the newly edited element (see above).
Delete an element. Only elements belonging to the "Item Type Metadata" element set may be deleted.
DELETE /elements/:id
An 204 No Content
response.
In addition to the general errors, requests to the elements resource my return the following errors:
-
400 Bad Request
- Invalid record. Only elements belonging to the "Item Type Metadata" element set may be deleted.