eZ Publish Rest API

Author Message

Alexandre Henriet

Tuesday 02 August 2011 6:52:19 am

Hi,I'm trying to use the eZ Publish REST API with eZ Publish version
"ezpublish_community_project-2011.7"

I don't want to extend the REST API, just to use "the initial set of resources exposed by the eZ Publish REST API " http://doc.ez.no/eZ-Publish/Technical-manual/4.5/Features/Rest-API/Resources

When I go to http://myhost:myport/api/ezp/v1/content/node/80 (existing node), I get the traditional
"An unexpected error has occurred. Please contact the webmaster."

And in the log files :[ Aug 02 2011 15:38:48 ] Unexpected error, the message was : No routes are defined in the router. in /opt/app/ezpublish/htdocs/lib/ezc/MvcTools/src/router.php on line 77

Here is the related configuration:

[System]PrefixFilterClass=ezpRestDefaultRegexpPrefixFilterApiPrefix=/api
[ApiProvider]ProviderClass[]ProviderClass[auth]=ezpRestAuthProvider
[DebugSettings]Debug=enabled
[OutputSettings]RendererClass[xhtml]=ezpContentXHTMLRenderer
[ezpRestContentController_viewContent_OutputSettings]Template=rest_pagelayout.tpl
[CacheSettings]# Global switch to enable/disable REST application cacheApplicationCache=enabled

...

[Authentication]RequireAuthentication=enabled# AuthenticationStyle=ezpRestOauthAuthenticationStyleAuthenticationStyle=ezpRestBasicAuthStyleRequireHTTPS=disabled# Default user to authenticate when authentication is disabled or the route used doesn't need authentication# If left empty, site.ini/[UserSettings].AnonymousUserID will be usedDefaultUserID=

...

[RouteSettings]RouteSettingImpl=ezpRestIniRouteFilter# Pattern for the skip filter# SkipFilter[]=controller_action;version# If the version component is not listed version "1" is assumed.SkipFilter[]SkipFilter[]=ezpRestErrorController_showSkipFilter[]=ezpRestAuthController_basicAuthSkipFilter[]=ezpRestAuthController_oauthRequiredSkipFilter[]=ezpRestOauthTokenController_handleRequest# Skip (auth) filter for every action in 'myController' which is of API version 2#SkipFilter[]=myController_*;2

 

Am I missing something ?

Thanks in advance,Alex

Alexandre Henriet

Wednesday 03 August 2011 12:54:47 am

Ok, I finally solved my problem thanks to : http://share.ez.no/forums/developer/trying-rest-api-but-keep-getting-provider-ezp-not-found

As I'm not the first one to meet the problem, it might be useful to mention in the documentation that an extension is still required to use the REST API despite the core functionality is integrated in the kernel.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Feb 03 2025 02:12:40
Script start
Timing: Feb 03 2025 02:12:40
Module start 'layout'
Timing: Feb 03 2025 02:12:40
Module start 'content'
Timing: Feb 03 2025 02:12:40
Module end 'content'
Timing: Feb 03 2025 02:12:40
Script end

Main resources:

Total runtime0.5109 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 588.0078152.6094
Module start 'layout' 0.00480.0042 740.6172216.0938
Module start 'content' 0.00910.5003 956.7109959.3281
Module end 'content' 0.50930.0016 1,916.03918.1875
Script end 0.5109  1,924.2266 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.7902160.0003
Check MTime0.00200.3876160.0001
Mysql Total
Database connection0.00070.128410.0007
Mysqli_queries0.461490.2996540.0085
Looping result0.00030.0580520.0000
Template Total0.480994.120.2404
Template load0.00230.448820.0011
Template processing0.478693.668120.2393
Template load and register function0.00110.220410.0011
states
state_id_array0.00090.184710.0009
state_identifier_array0.00060.123320.0003
Override
Cache load0.00190.3808280.0001
Sytem overhead
Fetch class attribute can translate value0.00030.066010.0003
Fetch class attribute name0.00170.327320.0008
XML
Image XML parsing0.00010.017610.0001
class_abstraction
Instantiating content class attribute0.00000.001020.0000
General
dbfile0.00080.1591100.0001
String conversion0.00000.001640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs