This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit

eZ Community » Forums » Extensions » Challenge with object_relation in...

Challenge with object_relation in REST API

Challenge with object_relation in REST API

Wednesday 16 November 2011 1:17:56 pm - 4 replies

Hi all,

I've created a class (mobile_app) with some object_relation-attributes. Following these with the field-service gives me the object_id of an element (say e.g. an event_calendar object), but as the object-service has now list-subservice, I can not get a list of the elements (i.e. event objects) placed under this element.

Any advice? Or do I need to hack the API?


Wednesday 16 November 2011 3:29:45 pm

I think you can go from object id to node id then to children ids...

Thursday 17 November 2011 10:17:07 pm

Think not.

First I get the app object

 {    "metadata": {        "objectName": "OTC2012",        "classIdentifier": "mobile_app",        "datePublished": 1321444513,        "dateModified": 1321444513,        "objectRemoteId": "a3914ffb634aff74b65df8c4b8609e76",        "objectId": 549,        "nodeId": 532,        "nodeRemoteId": "5d90476b8adc24bde4eef85cd9110df6",        "fullUrl": ""    },    "links": {        "name": "",        "events": "",        "participants": "",        "tips": "",        "important_info": "",        "*": ""    },    "requestedResponseGroups": [        "Metadata"    ]}

Then I get the events attribute (which is an object relation to an event_calendar object:

 {    "fields": {        "events": {            "type": "ezobjectrelation",            "identifier": "events",            "value": "234",            "id": 4458,            "classattribute_id": 419        }    },    "requestedResponseGroups": [        "FieldValues"    ]}

This gives med the object_id, not the node_id, and thus I have to get the object:

 {    "metadata": {        "objectName": "OTC 2012",        "classIdentifier": "event_calendar",        "datePublished": 1313750363,        "dateModified": 1313750363,        "objectRemoteId": "e62e90ebd329b7032d1eccba91a6d4f9",        "objectId": 234    },    "links": {        "title": "",        "short_title": "",        "view": "",        "*": ""    },    "requestedResponseGroups": [        "Metadata"    ]}

And from here I can't get to the event elements, as there is no list service for objects.

Friday 18 November 2011 11:22:35 am

When you request the object, you need to ask for the "locations" response group to get all the nodes it belongs to

Friday 18 November 2011 11:28:37 am

Hei Felix, 

You are right :


That said, extending the available services with your own is pretty quick. I am sure you already know this tutorial :


Let us know how things go sir !


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from