elgg_list_entities() is meant to return pre-formatted HTML as defined by the entity views. elgg_get_entities() will return just the entities so you're able to format them how you want. That one should work to just return entities, but you'll need to pass them to a view to format it how you want.
I don't know what format your client app expects, but it might be worthwhile implementing a new view for it.
Thanks man!!!, the format is still opened to discussion because I want first to finnish with the API and then, focus myself to develop the requests of the client part! :)
It won't be difficult to adapt what I already have :)
I have another question about general stuff
I am trying to make a simple XML HTTPRequest, using either Dashcode (currently developing an application) or using a htm file in my local server.
But I always obtain the same. DOM Exception, I don't know why.
I call the httprequest with:
And in my browser I obtain directly:
But if I create a htm file with:
<script type="text/javascript">
var xmlhttp=new XMLHttpRequest();
xmlhttp.open("GET","http://localhost/elgi1.7/html/services/api/rest/xml/?method=login&username=admin&password=h1tm@ke8&api_key=d7804b697fca84c17a30661667ed4bb75e3bd6e7",false);
xmlhttp.send(null);
xmlDoc=xmlhttp.responseXML;
</script>
It gives me the same DOM Exception that I get with the Dashcode code (similar coding), both javascripts.
And I don't know why :(
The REST API changed between Elgg 1.6 and Elgg 1.7. The biggest change is that the REST API had tons of bugs before Elgg 1.7. Another change is that the parameters for expose_function() changed. I really recommend working with 1.7 since it is so much more stable.
Another point is that right now the REST API does not support returning false as a successful result from an exposed function. Returning false is equivalent to saying the function failed and an error message will be returned. I'm still debating on whether that is a good idea.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.