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

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
vkakani's picture

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?

tyler.frankenstein's picture

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

Thanks for your prompt

vkakani's picture

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

tito.brasolin's picture

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.

vkakani's picture

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:

Hot content this week