Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. Hae JWT (voimassa tunnin ajan):
  2. POST https://mtgsuomi.fi/resources/ajax/login.php?username=tunnus&password=salakala (saa laittaa myös form parametreina)
  3. Response (application/json):
  4. {"jwt": token}
  5.  
  6. JWT testaus:
  7. GET https://mtgsuomi.fi/resources/ajax/login.php
  8. HTTP-Header Authorization: "Bearer <token>"
  9. Response:
  10. HTTP 200 "logged in as <username>"
  11. HTTP 401 "login failed"
  12.  
  13. Lisää/muokkaa turnausta:
  14. POST https://mtgsuomi.fi/resources/ajax/event.php
  15. HTTP-Header Authorization: "Bearer <token>"
  16. HTTP-Header Content-Type: "application/json"
  17. Body:
  18. {
  19. "name": String (required),
  20. "location": String (required),
  21. "date": String yyyy-MM-dd (required),
  22. "description": String (required),
  23. "url": String (optional, default ""),
  24. "canRegister": Boolean (optional, default false),
  25. "maxParticipants": Int (optional, default 0),
  26. "extrasAllowed": Boolean (optional, default false),
  27. "showRegistered": Boolean (optional, default false),
  28. "registerInfoAllowed": Boolean (optional, default false),
  29. "registerInfoTitle": String (optional, default ""),
  30. "id": Int (required, vain olemassaolevaa turnausta muokatessa)
  31. }
  32. Response (application/json):
  33. {
  34. "id": Int,
  35. "url": String
  36. }
  37.  
  38. Poista turnaus:
  39. DELETE https://mtgsuomi.fi/resources/ajax/event.php
  40. HTTP-Header Authorization: "Bearer <token>"
  41. HTTP-Header Content-Type: "application/json"
  42. Body:
  43. {
  44. "id": Int (required)
  45. }
  46. Response: HTTP 204
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement