eZ Community » Forums » eZ Publish 5 Platform » Integrates ezp with another app : use...
expandshrink

Integrates ezp with another app : use of rest api ?

Integrates ezp with another app : use of rest api ?

Tuesday 04 February 2014 12:47:47 pm - 3 replies

Hi

I have to say that I have very little knowledge of easy publish.

In my company we have an ezp site and a self made site and we want to integrate them together.

My first thought is to use the ezp rest api to fetch the data out of ezp and render it in my app : is this a realistic use case ? Is it easy with ezp rest api to get the data and modify it (link rewriting for example) ?

I am using ezp community 2012.8 : as far as i understand this is an ezp 5.0.0 version so it normally contains access to rest api v2.

But when i try to access the rest api I can only access v1 uris for example /api/ezp/content/node/2/list. Notice that in this case the v1 information is not in the uri.

Does I miss something ? is it normal in my case to not have the v2 uris available ?

On our installation another company made a rest extension : can this extension which is accessible on /api/ezx/v1/ have mess my rest configuration ?

I hope somebody can understand what I say and can answer my questions

Regards

Seb

Tuesday 04 February 2014 8:03:19 pm

Hi,

you should upgrade, REST api v2 wasn't really mature before 5.1, and in recent releases it has improved further. And given v1 and v2 are vastly different upgrading it recommended.

As for your question, yes you can do all that, just depends on what you mean by "render" it. Data from REST is not rendered for web use directly, but we plan to find a way to provide links to the web content so if your client needs to fetch html we will at some point try to have a convention for that.

Wednesday 05 February 2014 10:16:58 am

Hi,

Thanx for the answer

My main goal was to show the content not in ezp but in wy own app but as far as I understand this is not really possible because I can't get data ready for web use through rest api.

For the api usage I have another question.

You say that the v2 api isn't mature before 5.1 but what I don't understand is that in my case the v2 api seems unreachable.

For my understanding : is the v2 api managed by the index_rest.php file or by the index.php file ? In my case it seems that my installation was a migration from v4 and in my virtualhost i have a rewriterule

RewriteRule ^/api/ /index_rest.php [L]

but in the doc I found

RewriteRule ^/api/[^/]+/v1/ /index_rest.php [L]

Can this be my v2 access problem ?

Last question : if I want to upgrade my installation from community 2012.8 to community 2014.1 do I have to do each manual step for one version to the next one or can I do one big update ?

Regards

Seb

Wednesday 05 February 2014 10:46:56 am

The rewrite rule given in the ez default vhost is just an example, you should tweak it according to your needs.

But yes, the rewrite rule you are using is definitely a problem, as it will route calls for the new rest api to the legacy rest controller, which it should not.

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from