Thanks for a helpful module.

The documentation isn't really clear on how to access these resources. Could you help point me in the right direction?

Bradford

Comments

stone_d’s picture

... i came to these module by searching for a solution to publish/unpublish a node via JSON-POST.
But also dont know how to access those resources. I tried
{"publish"}
{"publish":"1"}
{"publish":"true"}
{"publish":"[my-node-ID]"}

None of those worked. Any hints?

Thanks in advance.

stone_d’s picture

ok - after a little more lookaround i found the solution:
You have to enable the so-called "targeted actions" in the node-ressource of your services-settings (http://...?q=admin/structure/services).

Then target those actions via JSON by URL:
- http://.../?q=rest/nodes/[YOUR-NODE-ID]/publish
- http://.../?q=rest/nodes/[YOUR-NODE-ID]/unpublish

Works perfect! :)

vvv8’s picture

Issue summary: View changes

This is not working for me. I have my services endpoint configured at api2

I can make all other requests just fine (i.e updating nodes etc) via http://mysite/?q=api2/node/ and from there I can do whatever I need to with a node.

Since the genius programmers who made the service module thought it was not important to deal with publishing / unpublishing I am now forced to use this module which has no documentation whatsoever - awesome!

I am testing on:

http://mysite/?q=api2/node/999/publish and http://mysite/?q=api2/node/999/unpublish and nothing is working... (999 being the nid)

Does anybody have any documentation on how these endpoints are supposed to work? The error that I am getting specifically for this is a 404 not found, when I have enabled the module and checked off the required 'publish' and 'unpublish' targeted actions...

Thanks