-
Notifications
You must be signed in to change notification settings - Fork 44
API V2
Sean Goller edited this page Jul 10, 2014
·
8 revisions
curl -v -H 'Content-Type: application/json' -H 'Accept: application/json' -X POST
http://localhost:3000/api/v2/users/sign_in -d "{\"user_login\":{\"email\":\"email\",\"password\":\"pwd\"}}"
curl -X POST -H "Content-Type: application/json" -d '{
"class": "Druid",
"oppclass": "Warlock",
"result": "Victory",
"coin":"false",
"mode":"Ranked",
"oppname":"Reynad",
"slot":2,
"notes":"Owned Him"}'
localhost:3000/api/v2/matches/new?auth_token=secret
To create other match types, simply use "mode":"Arena"
or "mode":"Casual"
.
- userkey - required
-
mode - Accepts
Arena
,Casual
, andRanked
- class - The player's class (e.g. "Mage", "Hunter", etc.)
- oppclass - The opponent's class (e.g. "Mage", "Hunter", etc.)
-
result - The result of the match - accepts
Victory
,Defeat
,Draw
-
coin - Whether or not the user had the coin - accepts
true
,false
- numturns - The number of turns the user had in the match
- duration - The duration of the match in seconds
- notes - Any notes to add to the match
-
slot - The deck slot number from 1 to 9 - required when
mode
isCasual
orRanked
-
ranklvl - If mode is
Ranked
this will set the exact rank level - accepts1
to25
curl -X POST -H "Content-Type: application/json" -d '{ "class": "Druid" }'
localhost:3000/api/v2/arena_runs/new?auth_token=secret
http://localhost:3000/api/v2/decks/show?auth_token=1ksXxGzZLY2jx9SaTWDT
This will allow developers to retrieve any matches of the user and thus calculate any stats specific to the user.
You can pass in any of these
mode: 1, 2, 3
result: 1, 2, 3
klass: 1, 2, 3, 4, 5, 6, 7, 8, 9
oppclass: 1, 2, 3, 4, 5, 6, 7, 8, 9
coin: true, false
season: [integer], 0 for current season
deck_id: id number of the deck to constrain results to
Mode: [1, Arena], [2, Casual], [3, Ranked] Result: [1, Victory], [2, Defeat], [3, Draw] Classes are in this order: ["Druid", "Hunter", "Mage", "Paladin", "Priest", "Rogue", "Shaman", "Warlock", "Warrior"]
http://localhost:3000/api/v2/matches/query?auth_token=secret&mode=2,3&result=2&coin=true
Support for multiple field still need to be done, this should be completed very soon.