Id: $Id: vpwikispec-0.1.txt,v 1.2 2004/02/12 04:06:15 gus Exp $ Author: $Author: gus $ Date: $Date: 2004/02/12 04:06:15 $ Revision: $Revision: 1.2 $ vpwiki api version 0.1 Copyright 2003 August Mueller NOTE: This is an outdated version of the spec. You should probably be looking at the newer api here: http://www.flyingmeat.com/vpwiki_api.html . However, VoodooPad 1.1. supports this api, and not the later ones (yet). I'm going to use python to describe what the objects look like, because I think just about everyone that's interested will be able to understand it. First, there are a couple of "structs" that need to be defined. The first one is the login struct: loginStruct = { 'username': 'steve', #string 'password': 'NeXT4ever' #string } It's pretty simple- just a username and a password. Next we have the page struct. This is the minimum required fields: pageStruct = { 'key': 'homepad', #string 'page':'Welcome to my personal wiki... etc', #string 'version': 5 #int } pageStruct may also contain more keys that just "key", "page" and "version". In the case of VoodooPad, it's going to send over more values. Here is what VoodooPad will send across (right now anyway). pageStruct = { 'key': 'homepad', #string 'page':'Welcome to my personal wiki... etc', #string 'version': 5 #int 'lastModified': 'Thu Aug 21 20:06:38 2003' #date 'rulerIsShowing': No #boolean 'title': 'homepad' #string 'data': #binary 'alias': 'homepad' #alias } An expliation on why both page and data are present- If you open up a page from within VoodooPad, and it has the "data" key in there, VoodooPad will fill up the editable contents with that. If it's not present, then it'll fall back on the plain text format of "page". Why wouldn't the data field be there? Well, in cases of where someone might use a different client such as the website, it might not be able to save back the rtfd data (which contains all the fancy formatting and images and such). Ok, now on to the methods: myboolean = vpwiki.authenticate(loginStruct) This method just takes a login struct and authenticates the user. It returns true if the user authenticates, false otherwise. myarray = vpwiki.getPageKeys(loginStruct) This method returns all the keys that the server has on it's end. If there are none, then it will return an empty array. mypageStruct = getPage(loginStruct, key) This method returns a pageStruct for the given key. myboolean = setPage(loginStruct, pageStruct) This method takes a pageStruct, and places it in the store. It returns a boolean on success, otherwise it'll throw an exception if something goes wrong. Comments or suggestions? gus@flyingmeat.com