One of the more hidden features of Elgg is the Export interface.
In a nutshell this interface provides an export view for Entities, Metadata, Annotations and relationships which can provide a convenient way of accessing data objects in a machine readable form.
The export url is constructed in different ways for entities, relationships and metadata.
All endpoints begin with:
Where [VIEW] is the format you want the data exported in – e.g. json, opendd, php or default.
To export a GUID simply add it to the end:
Annotations & Metadata
Metadata and annotation can be exported by providing the type (‘annotation’ or ‘metadata’) and the appropriate ID.
Follows the same format as above, but with [GUID] being the first guid in the relationship – in essence the entity to which the relationship “belongs”.
Some items of data (for example user passwords) are restricted from this export view. Exactly what is output by an output view is governed by
$object->getExportableValues(); which returns a list of exportable fields in the entity.
In addition, access permissions on the object are respected – meaning that if you can’t see an item in Elgg, you will not be able to see it in the export view either.