Differences between revisions 3 and 4
Revision 3 as of 2013-06-10 04:34:31
Size: 1192
Editor: AlanCabrera
Comment:
Revision 4 as of 2013-06-10 04:37:42
Size: 1316
Comment: - consistency and improvements
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
/steve/vote/board/20130521 /steve/vote/board/{election}
Line 7: Line 7:
{
  voterId: <user's unique hash>,
  ballot: <ballot characters>,
}
  Path param {election}, e.g., 20130521
  voterId: user's unique hash,
  ballot: ballot characters
Line 24: Line 23:
/steve/vote/member /steve/vote/member/{candidate}
Line 26: Line 25:
input: <user's unique hash>
        <yes|no|abstain>
input:
        Path param {candidate} Apache uid e.g., mattmann
        voterId:
user's unique hash
        ballot: yes|no|abstain

As we get more Python in there, here's what I'd like to set up with Python Bottle:

/steve/vote/board/{election}
POST
input: 
  Path param {election}, e.g., 20130521
  voterId: user's unique hash,
  ballot: ballot characters

output:
  code:
   HTTP 200 OK on success
   HTTP 500 on error
  payload:
    JSON formatted
     {
       msg: ""
     }

/steve/vote/member/{candidate}
POST
input: 
        Path param {candidate} Apache uid e.g., mattmann
        voterId: user's unique hash
        ballot: yes|no|abstain
output:
   code:
     HTTP 200 OK on success
     HTTP 500 on error
   paylod:
      JSON formatted
        {
          msg: ""
        }

/steve/list/board/{candidate}
  GET
    input: Path param candidate Apache uid, e.g., gstein
          (if not provided, all candidates, along with statements listed)
    output:
      HTTP 200 OK on success
      HTTP 404 if candidate not found (if provided)
      HTTP 500 on error
    payload:
       JSON formatted
         {
           [{uid:"gstein",
             nominatedby:"mattmann",
             secondedby:["kelly", "fielding"],
             accepted:"yes",
             statement: "yes",
             statementTxt:"here is my statement text"},
             {},{}]

SteveRESTAPI (last edited 2013-06-10 04:37:42 by ChrisMattmann)