/
datacode_category_get()

datacode_category_get()

Function prototype

datacode_category_get (session, category)

API Version

2.7.26 and higher

Supported interfaces

SOAP, REST

Description

Returns information about a DATACODE Category (a node of the DATACODE tree)

The information returned includes:

  • list of ancestors: other DATACODE categories of the DATACODE tree in which the requested category is a child (i.e. parent categories)

  • list of descendants: DATACODE categories of the DATACODE tree that are children of the requested category

  • list of DATACODES assigned to this category

Function parameters

Input parameters:

  • session: is the session token obtained in the session_init() call

  • category: reference of the desired DATACODE category.
    You can use the value “#ROOT” as a reference to the DATACODE tree root node.

Output parameters:

  • result: XML with the list of permissions

    • ref: reference of the DATACODE category

    • description: Description of the DATACODE category in the active session language

    • languages: List of descriptions in other languages. Note that the active session language description is not included, since it is provided in description.

      • lang: 2 letter ISO code

      • text: description in the corresponding language

    • descendants: list of categories that are children of the requested category

      • ref: reference of the DATACODE category

      • description: Description of the DATACODE category in the active session language

    • ancestors: list of categories where the requested category is a child (i.e. parent categories)

      • ref: reference of the DATACODE category

      • description: Description of the DATACODE category in the active session language

    • datacodes: List of DATACODES assigned to the requested category. The information contained in this node is the same than the one returned by datacode_get()

    • permissions:

      • edit: (true/false) Indicates whether the active user can modify the DATACODE category properties (e.g. the description)

      • edit_ref: (true/false) Indicates whether it is permitted to change the DATACODE category reference

      • alter_contents: (true/false) Indicates whether the active user can add or remove child categories or DATACODES from the requested category

  • ErrorMsg: If any error occurs, then this value contains a description of the error translated to the current language

  • ErrorCode: If any error occurs, then this value contains any of the standard ERROR CODES

Request example

datacode_category_get ( “LCAAAAAAAAAAAA”, "WEIGHT")

Response

The response format is XML when the function has been invoked via the SOAP API, and JSON when it has been invoked via the REST API

Return Error codes

ERROR CODE

 

ERROR CODE

 

INVALID_TOKEN

The session token provided is not valid

INSUFFICIENT_PRIVILEGES

The active session does not have permission to obtain information about the DATACODE

DATACODE_CATEGORY.NOT_FOUND

The DATACODE category requested does not exist.



Related content