Content partial contents
Summary of content partial contents endpoints
- GET /admin/api/content_partials - list all available content partial contents for the current site.
- GET /admin/api/content_partials/1 - get data for a single content partial content.
- PUT /admin/api/content_partials/1 - update attributes of a content partial content.
List all available content partial contents for the current site
GET /admin/api/content_partials
Example response:
Status: 200 OK
[
{
"id": 1,
"content_type": "custom",
"created_at": "2014-05-30T09:25:22.000Z",
"updated_at": "2014-05-30T09:26:17.000Z",
"url": "http://helloworld.voog.co/admin/api/content_partials/1",
"content": {
"id": 1,
"name": "body",
"created_at": "2014-05-30T09:25:22.000Z",
"updated_at": "2014-05-30T09:25:22.000Z",
"position": 1,
"url": "http://helloworld.voog.co/admin/api/pages/1/contents/1"
},
"parent": {
"id": 1,
"title": "Home page",
"created_at": "2014-05-30T09:22:49.000Z",
"updated_at": "2014-05-30T09:22:54.000Z",
"type": "page",
"url": "http://helloworld.voog.co/admin/api/pages/1"
}
}, {
"id": 2,
"content_type": "video",
"created_at": "2014-05-30T11:43:42.000Z",
"updated_at": "2014-05-30T11:44:07.000Z",
"url": "http://helloworld.voog.co/admin/api/content_partials/2",
"content": {
"id": 2,
"name": "body",
"created_at": "2014-05-30T11:43:42.000Z",
"updated_at": "2014-05-30T11:43:42.000Z",
"position": 2,
"url": "http://helloworld.voog.co/admin/api/pages/3/contents/2"
},
"parent": {
"id": 3,
"title": "Contact",
"created_at": "2014-05-30T11:43:37.000Z",
"updated_at": "2014-05-30T11:43:37.000Z",
"type": "page",
"url": "http://helloworld.voog.co/admin/api/pages/3"
}
}
]
Parameters
per_page- elements per response (default:50; maximum:250).page- requested page (default:1).parent_idandparent_type- parent id and type. Returns content partial contents for parent. If present then both parameters are required. Allowed values forparent_typeare:page- parent is page.languageparent is language.article- parent is article.
Filter attributes
Read more about filters.
- Object
content_partialattributes:id,body,metainfo,created_at,updated_at. - Object
contentattributes:id,parent_id,language_id,content_id,content_type,page_id,page_type,name,position,created_at,updated_at.
Get data for a single content partial content
GET /admin/api/content_partials/1
Example request:
GET http://helloworld.voog.co/admin/api/content_partials/2
Example response:
Status: 200 OK
{
"id": 2,
"content_type": "video",
"created_at": "2014-05-30T10:22:04.000Z",
"updated_at": "2014-05-30T10:22:04.000Z",
"url": "http://helloworld.voog.co/admin/api/content_partials/2",
"content": {
"id": 3,
"name": "body",
"position": 1,
"created_at": "2014-05-30T10:22:04.000Z",
"updated_at": "2014-05-30T10:22:04.000Z",
"url": "http://helloworld.voog.co/admin/api/pages/1/contents/3"
},
"parent": {
"id": 1,
"title": "Home page",
"type": "page",
"created_at": "2014-01-13T09:19:04.000Z",
"updated_at": "2014-01-13T09:19:04.000Z",
"url": "http://helloworld.voog.co/admin/api/pages/1"
},
"body": "<iframe scrolling=\"no\" style=\"width: 436px; height: 358.033px;\" src=\"http://www.youtube.com/embed/jTv3wWQDDgQ\"></iframe>",
"metainfo": {
"type": "video"
}
}
Update attributes of a content partial content
PUT /admin/api/content_partials/1
Example request:
PUT http://helloworld.voog.co/admin/api/content_partials/2
Example data:
{
"body": "<iframe scrolling=\"no\" style=\"width: 436px; height: 358.033px;\" src=\"http://www.youtube.com/embed/jTv3wWQDDgQ?wmode=transparent\"></iframe>",
"metainfo": {
"type": "custom"
}
}
Example response:
Status: 200 OK
{
"id": 2,
"content_type": "custom",
"created_at": "2014-05-30T10:22:04.000Z",
"updated_at": "2014-05-30T10:44:04.000Z",
"url": "http://helloworld.voog.co/admin/api/content_partials/2",
"content": {
"id": 3,
"name": "body",
"position": 1,
"created_at": "2014-05-30T10:22:04.000Z",
"updated_at": "2014-05-30T10:22:04.000Z",
"url": "http://helloworld.voog.co/admin/api/pages/1/contents/3"
},
"parent": {
"id": 1,
"title": "Home page",
"type": "page",
"created_at": "2014-01-13T09:19:04.000Z",
"updated_at": "2014-01-13T09:19:04.000Z",
"url": "http://helloworld.voog.co/admin/api/pages/1"
}
}
Parameters
Required parameters:
body- new content for the object.metainfo- parameters for content partial object. Known parameters:type- accepted parameters are:custom,mapandvideo. Is used to setcontent_typevalue.