Sections
Resource Fields
| Name | Type | Read-only | Description |
|---|---|---|---|
| titles | Field Locales | ||
| legacy_id | string | ||
| slugs | Field Locales | ||
| descriptions | Field Locales | ||
| visibility | string |
PUBLIC, AUTHORIZED, AGENTS Default: PUBLIC
|
|
| teams | Teams | ||
| tags | Tags | ||
| category | Category | ||
| agent | User | ||
| article_order_by | string |
LATEST, POPULAR, Default: LATEST
|
|
| total_articles | integer | ||
| created_at | timestamp | ISO-8601 Format | |
| updated_at | timestamp | ISO-8601 Format |
Metadata
| Version | 1.0 |
| Last Updated | July 04, 2016 |
Actions
Retrieve all sections
GET /api/v1/sections.jsonInformation
| Allowed for | Public |
| Ordered by | created_at (ascending) |
Arguments
| Name | Type | Mandatory | Description |
|---|---|---|---|
| category_id | integer | DEPRECATION: This field will be removed soon, use category_ids instead. |
|
| category_ids | string | Comma-separated list of category IDs to filter by |
OR
| Name | Type | Mandatory | Description |
|---|---|---|---|
| legacy_ids | string | The comma separated legacy ids |
Response
{
"status": 200,
"data": [
{
"id": 1,
"legacy_id": null,
"titles": [
{
"id": 1,
"resource_type": "locale_field"
}
],
"slugs": [
{
"locale": "en-us",
"translation": "1-brewing-equipment",
"resource_type": "slug"
}
],
"descriptions": [
{
"id": 1,
"resource_type": "locale_field"
}
],
"visibility": "PUBLIC",
"teams": [],
"tags": [],
"category": {
"id": 1,
"resource_type": "category"
}
,
"agent":
{
"id": 1,
"resource_type": "user_minimal"
}
,
"article_order_by": "LATEST",
"total_articles": 2,
"created_at": "2016-04-13T07:32:51+00:00",
"updated_at": "2016-04-13T07:32:51+00:00",
"resource_type": "section"
,"resource_url": "https://brewfictus.kayako.com/api/v1/sections/1"
}
],
"resource": "section",
"offset": 0,
"limit": 10,
"total_count": 1
}
Retrieve a section
GET /api/v1/sections/:id.jsonInformation
| Allowed for | Public |
Response
{
"status": 200,
"data": {
"id": 1,
"legacy_id": null,
"titles": [
{
"id": 1,
"resource_type": "locale_field"
}
],
"slugs": [
{
"locale": "en-us",
"translation": "1-brewing-equipment",
"resource_type": "slug"
}
],
"descriptions": [
{
"id": 1,
"resource_type": "locale_field"
}
],
"visibility": "PUBLIC",
"teams": [],
"tags": [],
"category": {
"id": 1,
"resource_type": "category"
}
,
"agent":
{
"id": 1,
"resource_type": "user_minimal"
}
,
"article_order_by": "LATEST",
"total_articles": 2,
"created_at": "2016-04-13T07:32:51+00:00",
"updated_at": "2016-04-13T07:32:51+00:00",
"resource_type": "section"
,"resource_url": "https://brewfictus.kayako.com/api/v1/sections/1"
}
,
"resource": "section"
}
Add a section
POST /api/v1/sections.jsonInformation
| Allowed for | Agents, Admins & Owners |
Parameters
| Name | Type | Mandatory | Description |
|---|---|---|---|
| titles | string | ||
| category_id | integer | ||
| legacy_id | string | ||
| descriptions | string | ||
| visibility | string | PUBLIC, AUTHORIZED, AGENTS Default: PUBLIC |
|
| tags | string | Comma separated value of tags. NOTE: Allowed for visibility AUTHORIZED and AGENTS otherwise server will ignore the tags |
|
| team_ids | string | Comma separated value of team ids. NOTE: Allowed for visibility AGENTS otherwise server will ignore the teams |
|
| article_order_by | string | LATEST, POPULAR Default: LATEST |
Request
curl -X POST https://brewfictus.kayako.com/api/v1/sections.json \
-d '{"titles":[{"locale":"en-us", "translation": "Brewing equipment"}], "descriptions":[{"locale":"en-us", "translation": "Brewing equipment description"}],"category_id":1, "tags": "", "team_ids": ""}' \
-H "Content-Type: application/json" \
-u "jordan.mitchell@brewfictus.com:jmit6#lsXo"
Response
{
"status": 201,
"data": {
"id": 1,
"legacy_id": null,
"titles": [
{
"id": 1,
"resource_type": "locale_field"
}
],
"slugs": [
{
"locale": "en-us",
"translation": "1-brewing-equipment",
"resource_type": "slug"
}
],
"descriptions": [
{
"id": 1,
"resource_type": "locale_field"
}
],
"visibility": "PUBLIC",
"teams": [],
"tags": [],
"category": {
"id": 1,
"resource_type": "category"
}
,
"agent":
{
"id": 1,
"resource_type": "user_minimal"
}
,
"article_order_by": "LATEST",
"total_articles": 2,
"created_at": "2016-04-13T07:32:51+00:00",
"updated_at": "2016-04-13T07:32:51+00:00",
"resource_type": "section"
,"resource_url": "https://brewfictus.kayako.com/api/v1/sections/1"
}
,
"resource": "section"
}
Bulk add sections
POST /api/v1/bulk/sections.jsonInformation
| Allowed for | Agents, Admins & Owners |
You can insert a maximum of 200 sections at a time
Parameters
| Name | Type | Mandatory | Description |
|---|---|---|---|
| sections | array | Array of sections to be inserted |
Arguments
| Name | Type | Mandatory | Description |
|---|---|---|---|
| partial_import | boolean | By default, even if a single record is invalid, the entire batch is dropped. However, if this parameter is set to true, all the records with no validation errors will be inserted while the invalid records will be returned back. |
Request
curl -X POST https://brewfictus.kayako.com/api/v1/bulk/sections \
-d '{"sections": [{"titles": [{"locale": "en-us", "translation": "Example Section"}], "tags": "", "team_ids": "", "category_id": 1, "creator_id": 1, "legacy_id": "section_1"}]}' \
-H "Content-Type: application/json"
Response
{
"status": 202,
"data": {
"id": 1,
"status": "PENDING",
"created_at": "2015-07-30T06:45:25+05:00",
"updated_at": "2015-07-30T06:45:25+05:00",
"resource_type": "bulk_job",
"resource_url": "https://brewfictus.kayako.com/api/v1/jobs/1"
}
,
"resource": "job"
}
Update a section
PUT /api/v1/sections/:id.jsonInformation
| Allowed for | Agents, Admins & Owners |
Parameters
| Name | Type | Mandatory | Description |
|---|---|---|---|
| titles | string | ||
| category_id | integer | ||
| descriptions | string | ||
| visibility | string | PUBLIC, AUTHORIZED, AGENTS |
|
| tags | string | Comma separated value of tags. NOTE: Allowed for visibility AUTHORIZED and AGENTS otherwise server will ignore the tags |
|
| team_ids | string | Comma separated value of team ids. NOTE: Allowed for visibility AGENTS otherwise server will ignore the teams |
|
| article_order_by | string | LATEST, POPULAR, MANUAL |
Request
curl -X PUT https://brewfictus.kayako.com/api/v1/sections/1.json \
-d '{"titles":[{"locale":"en-us", "translation": "Getting started"}], "descriptions":[{"locale":"en-us", "translation": "Getting started description"}],"category_id":1, "tags": "", "team_ids": ""}' \
-H "Content-Type: application/json" \
-u "jordan.mitchell@brewfictus.com:jmit6#lsXo"
Response
{
"status": 200,
"data": {
"id": 1,
"legacy_id": null,
"titles": [
{
"id": 1,
"resource_type": "locale_field"
}
],
"slugs": [
{
"locale": "en-us",
"translation": "1-brewing-equipment",
"resource_type": "slug"
}
],
"descriptions": [
{
"id": 1,
"resource_type": "locale_field"
}
],
"visibility": "PUBLIC",
"teams": [],
"tags": [],
"category": {
"id": 1,
"resource_type": "category"
}
,
"agent":
{
"id": 1,
"resource_type": "user_minimal"
}
,
"article_order_by": "LATEST",
"total_articles": 2,
"created_at": "2016-04-13T07:32:51+00:00",
"updated_at": "2016-04-13T07:32:51+00:00",
"resource_type": "section"
,"resource_url": "https://brewfictus.kayako.com/api/v1/sections/1"
}
,
"resource": "section"
}
Update sections
PUT /api/v1/sections.jsonInformation
| Allowed for | Agents, Admins & Owners |
Arguments
| Name | Type | Mandatory | Description |
|---|---|---|---|
| ids | string | The comma separated ids |
Parameters
| Name | Type | Mandatory | Description |
|---|---|---|---|
| category_id | integer | ||
| visibility | string | PUBLIC, AUTHORIZED, AGENTS |
|
| tags | string | Comma separated value of tags. NOTE: Allowed for visibility AUTHORIZED and AGENTS otherwise server will ignore the tags |
|
| team_ids | string | Comma separated value of team ids. NOTE: Allowed for visibility AGENTS otherwise server will ignore the teams |
|
| article_order_by | string | LATEST, POPULAR, MANUAL |
Response
{
"status": 200,
"total_count": 2
}
Delete a section
DELETE /api/v1/sections/:id.jsonInformation
| Allowed for | Agents, Admins & Owners |
Note: All articles in the section will also be deleted.
Response
{
"status": 200
}
Delete sections
DELETE /api/v1/sections.jsonInformation
| Allowed for | Agents, Admins & Owners |
Note: All articles in the section will also be deleted.
Arguments
| Name | Type | Mandatory | Description |
|---|---|---|---|
| ids | string | The comma separated ids |
Response
{
"status": 200,
"total_count": 2
}
Reorder Sections
PUT /api/v1/sections/reorder.jsonInformation
| Allowed for | Agents, Admins & Owners |
Parameters
| Name | Type | Mandatory | Description |
|---|---|---|---|
| section_ids | string | Pass the section ids in order you want to set | |
| section_id | integer | If not specified then the default brand will be applicable |
Response
{
"status": 200
}