Sections API¶
The section API supports creation, deletion, and updating of sections that can be used to categorize your content.
Creating sections¶
Creates a section.
POST /api/1.3/sections
Parameters¶
Name |
Type |
Description |
---|---|---|
|
String |
Title - Required |
|
String |
Slug - Required |
|
Array of strings |
Tags - Optional |
|
Integer |
Status - Optional
Choices:
-
1 : Private (Default)-
2 : Public-
3 : Unlisted |
|
String |
About - Optional |
|
String |
Meta title - Optional |
|
Object |
Page settings - Optional |
|
String |
URL header image - Optional |
|
Integer |
ID of the uploaded header image (it takes precedence over url_header_image) - Optional |
|
Integer |
Parent section ID - Optional |
|
Object |
Custom fields - Optional |
Page settings¶
page_settings
is a set of configurations that can be enabled or disabled.
Name |
Type |
Description |
---|---|---|
|
Boolean |
Controls whether the section must be opened in a new browser tab - Optional - Defaults to |
|
Boolean |
Controls whether community posts can be published in a section - Optional - Defaults to |
|
Boolean |
Controls whether the section is listed/available in entry editor - Optional - Defaults to |
|
Boolean |
Controls whether posts published to a specific section must be locked - Optional - Defaults to |
Note
After a section is created it will automatically be populated by posts that contain any of the configured tags for that section.
Response¶
{
"id": 100,
"title": "My section",
"url": "my-section",
"full_url": "my-section",
"status": 1,
"meta_title": null,
"page_settings": {
"hide_from_entry_editor": false,
"allow_community_posts": false,
"open_in_new_tab": false
},
"about_html": "",
"tags": ["foo", "bar"],
"url_header_image": "",
"site_id": 9,
"created_ts": 1507918417,
"order": 3,
"parent_id": 0,
"type": 2,
"extras": {},
"header_image_id": null
}
Editing sections¶
Edits a section.
PUT /api/1.3/sections/<id>
Parameters¶
The same response structure used in Creating sections is also used here, however there are no required fields.
Note
After a section is updated it is automatically assigned to posts that match by the new tags added and is going to be unassigned from articles by the removed tags.
Response¶
The same specification from Creating sections section applies here.
Deleting sections¶
Deletes a section.
DELETE /api/1.3/sections/<id>
Parameters¶
Name |
Type |
Description |
---|---|---|
destination_section_id |
Integer |
Destination section ID - Optional |
Note
Parameters need to be sent by query string. Posts are going be moved to destination section if any.
Response¶
The response payload is an empty object.
{}
List sections¶
Fetches sections information.
GET /api/1.3/sections
Parameters¶
Applying the following parameters will filter the response.
Name |
Type |
Description |
---|---|---|
|
Array of strings |
Fields to include in response – Optional |
|
Array of strings |
Fields to exclude in response – Optional |
Response¶
It returns a list of objects described at Creating sections section.
Get a single section¶
Fetch a single section by ID.
GET /api/1.3/sections/<id>
Response¶
The same specification from Creating sections section applies here.