Retrieve a specific version (vid) of a node : D7

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by vkakani on January 20, 2017 at 12:37am

How do we retrieve a specific revision (vid) attributes of a node.

Works : http://mysite.com/endpoint/node?parameters[nid]=5&parameters[vid]=34 [vid=34 is the latest version version id]

Doesn't Works : http://mysite.com/endpoint/node?parameters[nid]=5&parameters[vid]=31 [vid=31 is the second version version id]

Please advise, how to construct the query to pull the a specific version ID related node attributes

Drupal Version : D7

Comments

Bug?

Posted by tyler.frankenstein on January 20, 2017 at 12:54am

Looks correct, maybe that's a Feature Request for Services.

Thanks for your prompt

Posted by vkakani on January 20, 2017 at 1:03am

Thanks for your prompt response. I'm using this along with Workbench module, which creates REVISIONS based on the author new drafts. With parameters[vid]=31 it gives in an empty JSON array or an empty XML.

Wondering if there is any alternate solution

Services Views

Posted by tito.brasolin on January 21, 2017 at 1:00pm

Hi vkakani. I know it's not exactly what you asked for, but maybe Services Views is worth a look: https://www.drupal.org/project/services_views

Creating a view that shows revisions can be a little challenging, you can find some guidelines in this comment: https://www.drupal.org/node/1321288#comment-11229309

If you configure two contextual filters for "nid" and "vid" you should be able to invoke your view like this:

http://mysite.com/endpoint/views/<view name>?args[0]=<nid>&args[1]=<vid>

Thanks much tito.brasolin.

Posted by vkakani on January 23, 2017 at 6:53am

Thanks much tito.brasolin. Let me try it out and see if this works.

Thanks a bunch again!

Services

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /