• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Edit
Show / Hide Table of Contents

getCategories

Some tooltip text!
• 1 minute to read
 • 1 minute to read

Description

Retrieves all categories that are available in the system. If you wish to build a tree structure you can do this manually by checking the parent IDs of each category. The array returned is ordered so that each parentId has a corresponding id earlier in the array. This makes it easy to create a tree structure representation of the category hierarchy.

In parameters

Parameter Description
sessionKey A valid session key.

Out parameters

Parameter Description
errorCode See list of codes
categoryIds An array of all categories. Elements of this structure are as follows:
id (The category ID)
name (External category name)
parentId (The category ID of the parent. -1 if this is a top level category.)
isInternal (Boolean indicating if it is internal or external)

Example

string sessionKey;
ticket.ticketService ticketService = new ticket.ticketService();

if(ticketService.login("test","test", out sessionKey) == "0")
{
  ticket.CategoryStruct[] categoryIds;
  string res = ticketService.getCategories(sessionKey, out categoryIds);
}
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top