GetCategoryTree

From Wiki

Jump to: navigation, search

The 'getCategoryTree' API request will return a predefined number of category objects. If no category IDs are passed then no category objects will be returned.


Parameters


Element

Type

iCategoryId optional

The ID of the category

Value Type: int

bExpandAllBranches optional

Whether to expand all child and grandchild branches

Value Type: bool

iAdult optional

Allow adult content

Value Type: int


Response


oCategoryTree

Requested category tree objec

Value Type: CategoryTree


Example Request (parameters)


$aParams2 = array("iCategoryId"	=> 493, "bExpandAllBranches" => true);

$oResponse = $oClient->call('getCategoryTree', $aParams2);


Example Response


stdClass Object
(
    [oCategoryTree] => stdClass Object
        (
            [oCategory] => Array
                (
                    [0] => stdClass Object
                        (
                            [iId] => 97
                            [sName] => Clothing & Accessories
                            [sDescription] => Clothing & Accessories
                            [iAdult] => 0
                        )

                    [1] => stdClass Object
                        (
                            [iId] => 61
                            [sName] => Computers & Software
                            [sDescription] => Computers & Software
                            [iAdult] => 0
                        )

                    [2] => stdClass Object
                        (
                            [iId] => 4
                            [sName] => Electronics
                            [sDescription] => Electronics
                            [iAdult] => 0
                        )

                    [3] => stdClass Object
                        (
                            [iId] => 634
                            [sName] => Entertainment
                            [sDescription] => Entertainment
                            [iAdult] => 0
                        )

                    [4] => stdClass Object
                        (
                            [iId] => 173
                            [sName] => Gifts, Gadgets & Toys
                            [sDescription] => Gifts, Gadgets & Toys
                            [iAdult] => 0
                        )

                    [5] => stdClass Object
                        (
                            [iId] => 99
                            [sName] => Health & Beauty
                            [sDescription] => Health & Beauty
                            [iAdult] => 0
                        )

                    [6] => stdClass Object
                        (
                            [iId] => 421
                            [sName] => Home & Garden
                            [sDescription] => Home & Garden
                            [iAdult] => 0
                        )

                    [7] => stdClass Object
                        (
                            [iId] => 361
                            [sName] => Home Appliances
                            [sDescription] => Home Appliances
                            [iAdult] => 0
                        )

                    [8] => stdClass Object
                        (
                            [iId] => 540
                            [sName] => Jewellery
                            [sDescription] => Jewellery
                            [iAdult] => 0
                        )

                    [9] => stdClass Object
                        (
                            [iId] => 246
                            [sName] => Sports
                            [sDescription] => Sports
                            [iAdult] => 0
                        )

                    [10] => stdClass Object
                        (
                            [iId] => 347
                            [sName] => Telephones & Faxes
                            [sDescription] => Telephones & Faxes
                            [iAdult] => 0
                        )

                    [11] => stdClass Object
                        (
                            [iId] => 586
                            [sName] => Tickets
                            [sDescription] => Tickets
                            [iAdult] => 0
                        )

                    [12] => stdClass Object
                        (
                            [iId] => 328
                            [sName] => Travel
                            [sDescription] => Travel
                            [iAdult] => 0
                        )

                    [13] => stdClass Object
                        (
                            [iId] => 493
                            [sName] => Vehicles, Parts and Accessories
                            [sDescription] => Vehicles, Parts & Accessories
                            [iAdult] => 0
                            [oCategoryTree] => stdClass Object
                                (
                                    [oCategory] => Array
                                        (
                                            [0] => stdClass Object
                                                (
                                                    [iId] => 635
                                                    [sName] => Auto Care
                                                    [iParentId] => 493
                                                    [sDescription] => Auto Care
                                                    [iAdult] => 0
                                                )

                                            [1] => stdClass Object
                                                (
                                                    [iId] => 495
                                                    [sName] => Car Accessories
                                                    [iParentId] => 493
                                                    [sDescription] => Car Accessories
                                                    [iAdult] => 0
                                                    [oCategoryTree] => stdClass Object
                                                        (
                                                            [oCategory] => Array
                                                                (
                                                                    [0] => stdClass Object
                                                                        (
                                                                            [iId] => 507
                                                                            [sName] => Car Parts
                                                                            [iParentId] => 495
                                                                            [sDescription] => Car Parts
                                                                            [iAdult] => 0
                                                                        )

                                                                    [1] => stdClass Object
                                                                        (
                                                                            [iId] => 563
                                                                            [sName] => In-Car Entertainment
                                                                            [iParentId] => 495
                                                                            [sDescription] => In-Car Entertainment
                                                                            [iAdult] => 0
                                                                        )

                                                                )

                                                        )

                                                )

                                            [2] => stdClass Object
                                                (
                                                    [iId] => 564
                                                    [sName] => Motorcycles
                                                    [iParentId] => 493
                                                    [sDescription] => Motorcycles
                                                    [iAdult] => 0
                                                )

                                            [3] => stdClass Object
                                                (
                                                    [iId] => 567
                                                    [sName] => Vehicle Security
                                                    [iParentId] => 493
                                                    [sDescription] => Vehicle Security
                                                    [iAdult] => 0
                                                )

                                            [4] => stdClass Object
                                                (
                                                    [iId] => 569
                                                    [sName] => Vehicle Servicing
                                                    [iParentId] => 493
                                                    [sDescription] => Vehicle Servicing
                                                    [iAdult] => 0
                                                )

                                        )

                                )

                        )

                )

            [iActiveNode] => 493
        )

)

Privacy

Due to new European legislation regarding how websites store information about you, AWIN is updating its privacy policy. You can see the new version of our policy here. If you would like to see the information we capture on this website, please click here for further details. In order to accept cookies on this site please click the 'I ACCEPT' button