Categories

Resource Fields

Name Type Read-only Description
titles Field Locales
legacy_id string
slugs Field Locales
descriptions Field Locales
brand Brand
display_order integer
created_at timestamp ISO-8601 Format
updated_at timestamp ISO-8601 Format

Metadata




 
 




Actions

Retrieve all categories

GET /api/v1/categories.json

Information

Allowed for Public

Arguments

Name Type Mandatory Description
brand_id integer

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-getting-started",
            "resource_type": "slug"
        }
    ],
    "descriptions": [






{
    "id": 1,

    "resource_type": "locale_field"

}
    ],
    "brand": {
        "id": 1,
        "name": "Kayako",
        "resource_type": "brand",
        "resource_url": "https://brewfictus.kayako.com/api/v1/brands/1"
    },
    "display_order": 1,
    "created_at": "2016-04-13T07:32:51+00:00",
    "updated_at": "2016-04-13T07:32:51+00:00",

    "resource_type": "category"

    ,"resource_url": "https://brewfictus.kayako.com/api/v1/categories/1"

}

        ],
        "resource": "category",
        "offset": 0,
        "limit": 10,
        "total_count": 1
    }

Retrieve a category

GET /api/v1/categories/:id.json

Information

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-getting-started",
            "resource_type": "slug"
        }
    ],
    "descriptions": [






{
    "id": 1,

    "resource_type": "locale_field"

}
    ],
    "brand": {
        "id": 1,
        "name": "Kayako",
        "resource_type": "brand",
        "resource_url": "https://brewfictus.kayako.com/api/v1/brands/1"
    },
    "display_order": 1,
    "created_at": "2016-04-13T07:32:51+00:00",
    "updated_at": "2016-04-13T07:32:51+00:00",

    "resource_type": "category"

    ,"resource_url": "https://brewfictus.kayako.com/api/v1/categories/1"

}
,
        "resource": "category"
    }

Add a category

POST /api/v1/categories.json

Information

Allowed for Agents, Admins & Owners

Parameters

Name Type Mandatory Description
titles string
legacy_id string
descriptions string
brand_id integer

Request

curl -X POST https://brewfictus.kayako.com/api/v1/categories.json \
    -d '{"titles":[{"locale":"en-us", "translation": "Getting started"}], "descriptions":[{"locale":"en-us", "translation": "Getting started description"}],"brand_id":1}' \
    -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-getting-started",
            "resource_type": "slug"
        }
    ],
    "descriptions": [






{
    "id": 1,

    "resource_type": "locale_field"

}
    ],
    "brand": {
        "id": 1,
        "name": "Kayako",
        "resource_type": "brand",
        "resource_url": "https://brewfictus.kayako.com/api/v1/brands/1"
    },
    "display_order": 1,
    "created_at": "2016-04-13T07:32:51+00:00",
    "updated_at": "2016-04-13T07:32:51+00:00",

    "resource_type": "category"

    ,"resource_url": "https://brewfictus.kayako.com/api/v1/categories/1"

}
,
        "resource": "category"
    }

Bulk add categories

POST /api/v1/bulk/categories.json

Information

Allowed for Agents, Admins & Owners

You can insert a maximum of 200 categories at a time

Parameters

Name Type Mandatory Description
categories array
Array of categories 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/categories \
    -d '{"categories": [{"titles": [{"locale": "en-us", "translation": "Category 1"}], "descriptions": [{"locale": "en-us", "translation": "Category 1"}], "legacy_id": "cat_1", "brand_id": 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 category

PUT /api/v1/categories/:id.json

Information

Allowed for Agents, Admins & Owners

Parameters

Name Type Mandatory Description
titles string
descriptions string
brand_id integer

Request

curl -X POST https://brewfictus.kayako.com/api/v1/categories.json \
    -d '{"titles":[{"locale":"en-us", "translation": "Getting started"}], "descriptions":[{"locale":"en-us", "translation": "Getting started description"}],"brand_id":1}' \
    -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-getting-started",
            "resource_type": "slug"
        }
    ],
    "descriptions": [






{
    "id": 1,

    "resource_type": "locale_field"

}
    ],
    "brand": {
        "id": 1,
        "name": "Kayako",
        "resource_type": "brand",
        "resource_url": "https://brewfictus.kayako.com/api/v1/brands/1"
    },
    "display_order": 1,
    "created_at": "2016-04-13T07:32:51+00:00",
    "updated_at": "2016-04-13T07:32:51+00:00",

    "resource_type": "category"

    ,"resource_url": "https://brewfictus.kayako.com/api/v1/categories/1"

}
,
        "resource": "category"
    }

Update categories

PUT /api/v1/categories.json

Information

Allowed for Agents, Admins & Owners

Arguments

Name Type Mandatory Description
ids string
The comma separated ids

Parameters

Name Type Mandatory Description
brand_id integer

Response

{
    "status": 200,
    "total_count": 2
}

Reorder categories

PUT /api/v1/categories/reorder.json

Information

Allowed for Agents, Admins & Owners

Parameters

Name Type Mandatory Description
category_ids sections
Pass the category ids in order you want to set
brand_id integer If not specified then the default brand will be applicable

Response

{
    "status": 200
}

Delete a category

DELETE /api/v1/categories/:id.json

Information

Allowed for Agents, Admins & Owners

Note: All sections and articles in the category will also be deleted.

Response

{
    "status": 200
}

Delete categories

DELETE /api/v1/categories.json

Information

Allowed for Agents, Admins & Owners

Note: All sections and articles in the category will also be deleted.

Arguments

Name Type Mandatory Description
ids string
The comma separated ids

Response

{
    "status": 200,
    "total_count": 2
}