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: Jan 17 2025 23:53:46
Script start
Timing: Jan 17 2025 23:53:46
Module start 'layout'
Timing: Jan 17 2025 23:53:46
Module start 'content'
Timing: Jan 17 2025 23:53:47
Module end 'content'
Timing: Jan 17 2025 23:53:47
Script end

Main resources:

Total runtime0.8036 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.0042 588.9063152.6094
Module start 'layout' 0.00420.0030 741.515639.4375
Module start 'content' 0.00720.7947 780.9531433.1250
Module end 'content' 0.80190.0017 1,214.07818.1875
Script end 0.8036  1,222.2656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4260160.0002
Check MTime0.00140.1742160.0001
Mysql Total
Database connection0.00070.086510.0007
Mysqli_queries0.753793.7842540.0140
Looping result0.00050.0598520.0000
Template Total0.769795.820.3848
Template load0.00260.320320.0013
Template processing0.767195.451820.3835
Template load and register function0.00020.021810.0002
states
state_id_array0.00100.130510.0010
state_identifier_array0.00130.157820.0006
Override
Cache load0.00190.2379280.0001
Sytem overhead
Fetch class attribute can translate value0.00100.129810.0010
Fetch class attribute name0.00130.157820.0006
XML
Image XML parsing0.00010.018410.0001
class_abstraction
Instantiating content class attribute0.00000.000620.0000
General
dbfile0.00540.6723100.0005
String conversion0.00000.001040.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.0004 secs