k4ever/devel/api

92 lines
2.3 KiB
Plaintext

API
kaufen
produkte
auflisten
alle, nach gruppe
produktgruppen auflisten
suchen nach namen
hasDeposit falls kein attribut
beliebteste produkte (allgemein, nur vom user)
kaufen eines items (mit oder ohne deposit)
pfand zurückgeben
letzte einkäufe
transaction
auflisten zahlarten (bar, ueberweisung, ...)
einzahlen
auszahlen
letzte einzahlungen
api auth stuff
if plugin identifies by authblob
getUsersByAuthBlob (oderso)
else
authenticateUser(user, authblob)
listAuthBlobs (fuer alle user, die das plugin erlaubt haben)
canSuAsUser (noch ordentlich zu benennen)
cool wäre:
irgendwann letzte Änderung der produktliste speichern
TODO
write loader for url-encoded POST data
write "bash" output format
=== REST LIKE API STARTS HERE ===
buyable/
item/<itemId>
GET (=list)
""" get a specific item or a full (group) item list """
group item belonging to group
POST (=buy)
""" buy an item"
deposit Set to > 0 if you want to buy with deposit (default 0)
amount amount of items to buy (default 1)
types/
GET (=list)
""" list all types (groups) which an item can belong to """
history/
GET (=list)
""" list the last orders of a user """
num number of entries
account/
transactions/ or transfers/
transact/ or transfer/ # sollte eigentlich transfer heißen imo
GET (=list)
""" list your transactions """
num list $num entries
POST (=pay)
""" actually transact money """
amount [REQ] amount to add to your account
type [REQ] type of transaction (id)
types/
GET (=list)
""" list all available transaction types"
balance/
GET (=show)
""" return current account balance """
auth/
blob/
GET (=get)
""" return authblob if allowed or auth if str given """
blob blob to get user from / auth user with, returns User or NULL
POST
""" set authblob if allowed """
user/
GET (=get)
""" get user by authblob string - this function works only when plugin
has unique authblobs """
authblob [REQ] authblob to sear
config/
GET (=get)
""" Display site configuration vars (as in mediaurl) """
wget -qS -O- --auth-no-challenge --http-user=seba --http-password=foobar23 http://devcat.someserver.de:13805/api2/buyable/item/foo