Skip to content

API Category

Compatibility

  • EE2
  • EE3
  • EE4
  • EE5
  • EE6
  • EE7

Installation

  1. Copy the files to the system/user/ dir
  2. Enable the API from within the Webservice Module

Methods

create_category

Short nameDescription
group_idThe group idRequired
parent_idThe parent category idOptional
cat_nameThe category nameRequired
cat_descriptionThe category descriptionOptional
cat_orderThe order idOptional
custom_fieldAny custom fieldOptional

Request

Array
(
    [group_id] => 1
    [parent_id] => 1 
    [cat_name] => test category
    [cat_description] => test description
)

read_category

Short nameDescription
cat_idThe category idOptional
cat_url_titleThe category url_titleOptional
group_idThe Group IDOptional
site_idTHe site IDOptional
include_cat_group_idIf set with any kind of value, the category group is includedOptional
include_entries_idIf set with any kind of value, the entries associated with the category are includedOptional

Request

Array
(
    [cat_id] => 2
)

update_category

Short nameDescription
cat_idThe category idRequired
group_idThe group idOptional
parent_idThe parent category idOptional
cat_nameThe category nameOptional
cat_descriptionThe category descriptionOptional
cat_orderThe order idOptional
custom_fieldAny custom fieldOptional

Request

Array
(
    [cat_id] => 1
    [group_id] => 1
    [parent_id] => 1 
    [cat_name] => test category
    [cat_description] => test description
    [cat_order] => 3
)

delete_category

Short nameDescription
cat_idThe id of the categoryRequired

Request

Array
(
    [cat_id] => 2
)

Hooks

webservice_create_category_end

(added in v2.2)

ee()->extensions->call('webservice_create_category_end', $category_id);

webservice_read_category_end

(added in v2.2)

ee()->extensions->call('webservice_read_category_end', $category_data);

webservice_update_category_end

(added in v2.2)

ee()->extensions->call('webservice_update_category_end', $category_data);

webservice_delete_category_end

(added in v2.2)

ee()->extensions->call('webservice_delete_category_end', '');