Unable to get REST API working

Author Message

Felix Laate

Wednesday 06 July 2011 1:19:16 am

Hi all!

On a site running 2011.5, I try to utilize the new REST API. I tried the built-in extension (restapiprovider), but it only returns blank pages. The error-logs says nothing.

Then I tried to make an extension as documented in the docs, but that only gives an unexpected error. The error-log says "Unexpected error, the message was : The API provider 'ezx' could not be found. in /home/greaterstavanger/www/kernel/private/rest/classes/rest_provider.php on line 37".

Que pasa, anybody?

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Markus Birth

Wednesday 06 July 2011 2:10:07 am

Things to check:

  • are your RewriteRules correct (RewriteRule ^api/ index_rest.php [L])?
  • did you do correct OAuth 2.0 authentication (http://example.org/oauth/authorize)?
  • does the user have the correct rights/permissions to use the REST API?
  • do you send Authorization and Accept headers with your REST request?

You can try the communication using Jérôme's eZ REST Debugger.

Thiago Campos Viana

Wednesday 06 July 2011 4:46:27 am

I've got some poblems using 2011.5, so I suggest you upgrade to the latest build (2011.6), then you could check my Rest API "Hello world" topic and my blog post: REST API, Basic HTTP Auth, and PhoneGap using jQuery

Just don't forget to change your install settings to use virtual host and remove the index.php from your SiteURL settings and so on...

eZ Publish Certified Developer: http://auth.ez.no/certification/verify/376924

Twitter: http://twitter.com/tcv_br

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