k4ever/devel/api

92 lines
2.3 KiB
Plaintext
Raw Normal View History

2011-09-28 10:51:32 +02:00
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<75>ckgeben
letzte eink<6E>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 <20>nderung der produktliste speichern
2011-09-29 23:38:25 +02:00
TODO
write loader for url-encoded POST data
write "bash" output format
2011-09-28 10:51:32 +02:00
=== REST LIKE API STARTS HERE ===
buyable/
2011-09-29 00:26:39 +02:00
item/<itemId>
2011-09-28 10:51:32 +02:00
GET (=list)
""" get a specific item or a full (group) item list """
group item belonging to group
POST (=buy)
""" buy an item"
2011-09-29 00:26:39 +02:00
deposit Set to > 0 if you want to buy with deposit (default 0)
amount amount of items to buy (default 1)
2011-09-28 10:51:32 +02:00
types/
GET (=list)
""" list all types (groups) which an item can belong to """
2011-10-02 17:58:54 +02:00
history/
GET (=list)
""" list the last orders of a user """
num number of entries
2011-09-28 10:51:32 +02:00
2011-09-29 00:26:39 +02:00
account/
2011-09-29 02:37:46 +02:00
transactions/ or transfers/
transact/ or transfer/ # sollte eigentlich transfer hei<65>en imo
2011-09-29 00:26:39 +02:00
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/
2011-09-29 02:37:46 +02:00
GET (=show)
""" return current account balance """
2011-09-28 10:51:32 +02:00
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
2011-09-28 10:51:32 +02:00
2011-09-29 23:38:25 +02:00
config/
GET (=get)
""" Display site configuration vars (as in mediaurl) """
2011-09-28 10:51:32 +02:00
2011-09-29 00:26:39 +02:00
wget -qS -O- --auth-no-challenge --http-user=seba --http-password=foobar23 http://devcat.someserver.de:13805/api2/buyable/item/foo