-
Notifications
You must be signed in to change notification settings - Fork 197
API : Collections
jimsafley edited this page Jun 3, 2013
·
11 revisions
Return data about the specified collection.
GET /collections/:id
{
"id": 1,
"url": "http://yourdomain.com/api/collections/1",
"public": true,
"featured": false,
"added": "2013-03-27T08:17:37+00:00",
"modified": "2013-04-21T15:05:07+00:00",
"owner": {"id": 1, "url": "/users/1"},
"items": {"count": 100, "url": "http://yourdomain.com/api/items?collection=1"},
"element_texts": [
{
"html": false,
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"element_set": {"id": 1, "url": "http://yourdomain.com/api/element_sets/1", "name": "Dublin Core"},
"element": {"id": 1, "url": "http://yourdomain.com/api/elements/1", "name": "Title"}
}
]
}
Return data about collections.
GET /collections
- public: boolean
- featured: boolean
- added_since: string (ISO 8601)
- modified_since: string (ISO 8601)
- owner (user): integer
An array of JSON collection representations (see above).
Create a new collection.
POST /collections
{
"public": true,
"featured": false,
"element_texts": [
{
"html": false,
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"element": {"id": 1}
}
]
}
Location: http://yourdomain.com/api/collections/:id
An JSON representation of the newly created collection (see above).
Edit an existing collection.
PUT /collections/:id
{
"public": true,
"featured": false,
"element_texts": [
{
"html": false,
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"element": {"id": 1}
}
]
}
An JSON representation of the newly edited collection (see above).
Delete a collection.
DELETE /collections/:id
An 204 No Content
response.