GetFrags

From ARK
Revision as of 11:26, 12 November 2013 by Stuarteve (talk | contribs) (Arguments)

Jump to: navigation, search

This method is used to get a list of data fragments of a specific dataclass and/or classtype within the ARK instance. It will return a JSON array of all the different data fragments attached to a specific item

Path

http://your.ark.instance/api.php?request=getFrags

Arguments

Mandatory

  • item_key - this is the item_key of the required module (for instance 'cxt_cd').
  • item_value - this is the ARK item that you are interested in. This should be sent in the form item_key=item_value. As an example: cxt_cd=LK12_1. A list of available items can be supplied by describeItems.
  • dataclass - this can be any of the main dataclasses, e.g. action,attribute, date, span, xmi, txt, number,file. If you want to return all of the possible data fragment types then set the argument to 'all'.

Optional

  • classtype - if you are only interested in a particular type of data then you can send the classtype as well and this will limit the results
  • aliased - set this argument to 'true' if you want the human-readable aliases to be returned

If anonymous logins are not enabled a username and password will need to be supplied:

  • handle - username
  • passwd - password

Example

http://your.ark.instance/api.php?request=getItems&item_key=hut_cd&handle=johndoe&passwd=johndoepassword

Example return (returned JSONified - displayed as an array here for ease of viewing):

Array
(
    [hut] => Array
        (
            [0] => Array
                (
                    [0] => LK12_1
                    [hut_cd] => LK12_1
                    [1] => 1
                    [hut_no] => 1
                    [2] => LK12
                    [ste_cd] => LK12
                    [3] => 1
                    [cre_by] => 1
                    [4] => 2012-05-24 00:00:00
                    [cre_on] => 2012-05-24 00:00:00
                )

            [1] => Array
                (
                    [0] => LK12_2
                    [hut_cd] => LK12_2
                    [1] => 2
                    [hut_no] => 2
                    [2] => LK12
                    [ste_cd] => LK12
                    [3] => 1
                    [cre_by] => 1
                    [4] => 2012-05-24 00:00:00
                    [cre_on] => 2012-05-24 00:00:00
                )

            [2] => Array
                (
                    [0] => LK12_3
                    [hut_cd] => LK12_3
                    [1] => 3
                    [hut_no] => 3
                    [2] => LK12
                    [ste_cd] => LK12
                    [3] => 0
                    [cre_by] => 0
                    [4] => 0000-00-00 00:00:00
                    [cre_on] => 0000-00-00 00:00:00
                )

        )
)