-
Notifications
You must be signed in to change notification settings - Fork 44
API V1
trigun0x2 edited this page May 15, 2014
·
9 revisions
The HearthStats API
Response
{"status":"success",
"data":{
"complete":false,"created_at":"2014-01-25T19:15:53Z",
"dust":0,
"gold":0,
"id":1833,
"notes":null,
"patch":"current",
"updated_at":"2014-01-25T19:15:53Z",
"user_id":1,
"userclass":"Rogue"
}
}
Match Entry
curl -X POST -H "Content-Type: application/json" -d '{"slot":1,"class": "Mage", "oppclass": "Druid","result": "Draw" ,"coin":"false", "rank":1, "mode": "Casual", "oppname":"MubaMu22ba"}' localhost:3000/api/v1/matches/new?userkey=secret
Parameters
- 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
Last Arena Run
http://localhost:3000/api/v1/arena_runs/show?userkey=secret
Start Arena Run
curl -X POST -H "Content-Type: application/json" -d '{ "klass_id": 2 }' localhost:3000/api/v1/arena_runs/new?userkey=secret
End Arena Run
Use matches method above with mode
set to Arena
Arena Entry
curl -X POST -H "Content-Type: application/json" -d '{"class": "Mage", "oppclass": "Druid","result": "Draw" ,"coin":"false", "rank":1, "mode": "Casual", "oppname":"MubaMu22ba", "notes":"Schooling"}' localhost:3000/api/v1/matches/new?userkey=sercret
Constructed Entry
Use matches method above with mode
set to Casual
or Ranked
Activate/Deactivate Deck
curl -X POST -H "Content-Type: application/json" -d '{"deck_id": 1652}' http://localhost:3000/api/v1/decks/activate?userkey=secret
Note that the deck id must belong to the user or an error will occur
Show All Decks
http://localhost:3000/api/v1/decks/show?userkey=secret
Show All Cards
curl http://localhost:3000/api/v1/cards/
Show Specific Card
curl http://localhost:3000/api/v1/cards/:id