Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hae JWT (voimassa tunnin ajan):
- POST https://mtgsuomi.fi/resources/ajax/login.php?username=tunnus&password=salakala (saa laittaa myös form parametreina)
- Response (application/json):
- {"jwt": token}
- JWT testaus:
- GET https://mtgsuomi.fi/resources/ajax/login.php
- HTTP-Header Authorization: "Bearer <token>"
- Response:
- HTTP 200 "logged in as <username>"
- HTTP 401 "login failed"
- Lisää/muokkaa turnausta:
- POST https://mtgsuomi.fi/resources/ajax/event.php
- HTTP-Header Authorization: "Bearer <token>"
- HTTP-Header Content-Type: "application/json"
- Body:
- {
- "name": String (required),
- "location": String (required),
- "date": String yyyy-MM-dd (required),
- "description": String (required),
- "url": String (optional, default ""),
- "canRegister": Boolean (optional, default false),
- "maxParticipants": Int (optional, default 0),
- "extrasAllowed": Boolean (optional, default false),
- "showRegistered": Boolean (optional, default false),
- "registerInfoAllowed": Boolean (optional, default false),
- "registerInfoTitle": String (optional, default ""),
- "id": Int (required, vain olemassaolevaa turnausta muokatessa)
- }
- Response (application/json):
- {
- "id": Int,
- "url": String
- }
- Poista turnaus:
- DELETE https://mtgsuomi.fi/resources/ajax/event.php
- HTTP-Header Authorization: "Bearer <token>"
- HTTP-Header Content-Type: "application/json"
- Body:
- {
- "id": Int (required)
- }
- Response: HTTP 204
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement