Wednesday 23 March 2011 9:27:06 am
Hello ! I am using REST API with ez publish 4.4 (with ez flow) and it seems to work well when getting some node contents. If I make the request : http://mysite/index_rest.php/api/ezp/content/node/2/fields I will get an answer containing different structured information like : exempleArrayexemple2Array{"fields":{"name":{"type":"ezstring","identifier":"name","value":"Home"},"page":{"type":"ezpage","identifier":"page","value":"<?xml version=\"1.0\"?>\n<page>\n <zone_layout>Layoutcol1<\/zone_layout>\n <zone id=\"id_082188b2a113cc866cbcf6ca6e5ce7d3\">\n <zone_identifier>main<\/zone_identifier>\n <block id=\"id_02b7970476cb37a908d5a9815b630f63\">\n <name>Main story<\/name>\n <zone_id>082188b2a113cc866cbcf6ca6e5ce7d3<\/zone_id>\n <type>MainStory<\/type>\n <view>main_story1<\/view>\n <overflow_id><\/overflow_id>\n <\/block>\n <block id=\"id_9e678c6b3a4c8ab4c6305df3990870e1\">\n <name>2 news block<\/name>\n <zone_id>082188b2a113cc866cbcf6ca6e5ce7d3<\/zone_id>\n <type>Manual2Items<\/type>\n <view>2_items1<\/view>\n <overflow_id><\/overflow_id>\n <\/block>\n <block id=\"id_9202cce2b5f34df64f2f0acd5f653930\">\n <name>eZ Conference 2010<\/name>\n <zone_id>082188b2a113cc866cbcf6ca6e5ce7d3<\/zone_id>\n <type>MultimediaCarousel<\/type>\n <fetch_params>a:2:{s:7:\"Classes\";s:5:\"image\";s:6:\"Source\";s:2:\"64\";}<\/fetch_params>\n <view>multimediacarousel<\/view>\n <overflow_id><\/overflow_id>\n <\/block>\n <block id=\"id_39bd28823261d0630c4e2f4187d4b446\">\n <name>Ads<\/name>\n <zone_id>082188b2a113cc866cbcf6ca6e5ce7d3<\/zone_id>\n <type>Banner<\/type>\n <view>banner1<\/view>\n <\/block>\n <\/zone>\n<\/page>\n"},"tags":{"type":"ezkeyword","identifier":"tags","value":""}}} The problem is that I would like to get the content of a specific block. For example, I would like to be able to fetch the "MainStory" block content, with a request like : http://mysite/index_rest.php/api/ezp/content/object/57/field/02b7970476cb37a908d5a9815b630f63 (where 57 is found in the back office, not in the previous request, which is a problem) But the server answers "exempleArrayexemple2ArrayAn unexpected error has occurred. Please contact the webmaster." I probably did something bad or inappropriate, but if you have any idea I could try in order to get a block content, it would be very nice. Thank you very much, Olivier
|