Skip to content

API for Metadata queries

vtiffenberg edited this page Nov 17, 2014 · 4 revisions

Metadata

Note: You need to be the admin of the collection to be allowed to query the following information

You can get a definition of your layer metadata here:

  • /api/collections/350/layers.json

This will return all metadata about fields (codes, lookup values and codes, etc) in the collection with ID = 350, grouped in layers.

If you need only the fields and not the layers information:

  • GET /api/collections/350/fields.json

Single field - OBSOLETE

For receiving a single Field (with ID=12):

  • GET /collections/350/fields/12.json

If the field is hierarchical you can also get all the hierarchy definiton here:

  • GET /collections/350/fields/12/hierarchy.json

Or getting only the elements under certain node: (TZ.CL is the ID of a particular hierarchy node)

  • GET /collections/350/fields/12/hierarchy.json?under=TZ.CL

To ask if a node is under another one:

  • GET /collections/350/fields/12/hierarchy.json?under=TZ.CL&node=TZ.CL.DO.BA

Only lookup fields

GET /api/collections/350/fields/mapping.json

This will return a mapping between the field's codes, name, id and kind, not all the available options or other metadata about the fields.