eZ Community » Forums » General » eZ Publish Rest API
expandshrink

eZ Publish Rest API

eZ Publish Rest API

Tuesday 02 August 2011 3:52:19 pm - 2 replies

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

Modified on Tuesday 02 August 2011 4:01:12 pm by Alexandre Henriet

Wednesday 03 August 2011 9: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.

Monday 26 March 2012 11:43:12 pm

I'm getting the same error, but the extension IS installed and activated (in settings/override/site.ini->ActiveExtensions), autoloads have been regenerated and cache cleared.  Using .htaccess and the /api/rest/content/node/2 request IS being passed to it.

I'm using 4.7alpha1 with the latest ezprestapiprovider from the repo.

Any ideas?

Thanks in advance,

Geoff

[Update: I was using the wrong URI above - should have been /api/ezp/content/node/2 - RTFM!]

Modified on Monday 26 March 2012 11:47:09 pm by Geoff Bentley

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from