Needs review
Project:
Voting API services
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
9 Oct 2007 at 19:06 UTC
Updated:
15 Apr 2018 at 17:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
robloachThis should be put into the Vote Up/Down module instead as only core services should go into the Services module package.
Comment #2
jjjames commentedI can't get this to work. I tried patching http://drupal.org/node/170783 and it didn't work. Can you please tell me how to get this working?'Thanks
Comment #3
Fixdit commentedDoes this work? It's just what I'm looking for if it does! Is there anyway I can give?
Comment #4
mitchell commentedMarking as a duplicate of #241453: Services support for Voting API.
Comment #5
beauz commentedHas anyone updated this recently for drupal 6?
Comment #6
MD3 commentedSince there is no official release of VotingAPI Services years later and I think most people would have a hard time figuring out all of the different options when trying to submit a vote, I have created the following Services 3.x patch to be included with Vote Up/Down. I didn't realize that my server is on 2.8. It is a production system, so I will be glad to upgrade this patch to 3.x as needed when I can convert my server to that version.
I need the community to test the taxonomy option, as I do not have this installed on my server and do not have time right now to set up a test site for this.
Please read the inc file to see the endpoints. They attach themselves to relevant content type. So, to vote up a node:
POST {endpoint}/node/{nid}/voteupdown/1
down:
POST {endpoint}/node/{nid}/voteupdown/-1
unvote:
POST {endpoint}/node/{nid}/voteupdown/-0
Get all of the votes:
GET {endpoint}/node/{nid}/voteupdown
Comment #8
marvil07 commented@MD3: I do not see any specific about vote up down that make it worth to maintain so much new code. Actually, it seems like it could be generalized for votingapi.
I guess the sandbox mentioned on comment 23(#241453-23: Services support for Voting API), which is compatible with services 3.x would be enough to avoid needing this submodule in D7. If you need a D6 version I would say to coordinate with the sandbox creator and make a branch for D6 there would be the best idea, so I am moving the issue there.
Comment #9
MD3 commented@marvil07: I can see your point as the awesome guy who maintains this module ;-)! But, if we're going to take that stance, then we need to write up something about how VUD uses the VotingAPI. Unless I had gone through the code, I would have no idea how you're using the API, or that 0 undoes a vote. Plus, if I'm an iPhone Dev, I just want a simple address and a simple way to vote up and down on a node, comment, taxonomy term.
Here's what you do that is special:
-List Sum, Average, Total, Positives, Negatives of a node, comment, taxonomy term in one simple query. With VotingAPI, I would have to make the call 5 times as an iPhone/Android Dev.
-Sanitize values to be 1, 0 or -1. VotingAPI does not do this.
Really, the only code that needs to be maintained is the two functions at the bottom that interact with the VotingAPI. The rest of it is Services arrays and sub functions to sanitize input from users that really isn't going to change much (ok ... checking if a node or comment exists will be slightly different in D7 vs D6!).