Calling the VEKN API 1/ Getting a token First of all, the application using the API must get an authentication token by calling the following API: POST: https://www.vekn.net/api/vekn/login Body: form-data with username: password: The query will return { "err_msg": "", "err_code": "", "response_id": "5ed3d09282c67", "api": "vekn.login", "version": "", "data": { "auth": "", "code": "200", "id": "", "jwt": "" } } The only thing that matters here is the in "auth" The token expires 5 minutes after it has been requested. Therefore, you must call the token API before each call (or handle the 403 error code "API Key Not Found" when the token is expired). 2/ Calling the API Using the following header: Content-Type: application/x-www-form-urlencoded Authorization: Bearer You will be able to call the following APIs: (Names have been replaced in response bodies with **anonymized**) 2.a) registry Returns the first 50 players matching the filters. Any numeric filter will be matched against the VEKN id first digits. Any textual part will be matched against the first name or last name. GET https://www.vekn.net/api/vekn/registry?filter= : eg. filter=vincent%20rip : eg. filter=vincent%203200 "err_msg": "", "err_code": "", "response_id": "5ed3d931359b0", "api": "vekn.registry", "version": "", "data": { "players": [ { "veknid": "1234568", "firstname": "Foo", "lastname": "Bar", "statename": "Languedoc-Roussillon", "countryname": "France" }, { "veknid": "5454545", "firstname": "John", "lastname": "Doe", "statename": "Québec", "countryname": "Canada" }, ... ] } } 2.b) event Returns all events happening on a given date (eg. March, 4th 2023) and created by the logged user. GET https://www.vekn.net/api/vekn/event?date=2023-03-04 Returns the event with a given id. GET https://www.vekn.net/api/vekn/event/10587 (Players from rank 7 to 20 have been snipped) { "err_msg": "", "err_code": "", "response_id": "64070854dd2e7", "api": "vekn.event", "version": "", "data": { "events": [ { "event_id": "10587", "event_name": "Coupe de Paris", "event_startdate": "2023-03-04", "event_starttime": "10:00:00", "event_enddate": "2023-03-04", "event_endtime": "20:00:00", "event_isonline": "0", "organizer_veknid": "3200188", "venue_id": "2847", "venue_name": "Troll2Jeux", "venue_city": "Paris", "venue_country": "FR", "eventtype_id": "2", "eventtype_name": "Standard Constructed", "rounds": "3R+F", "attendance": 23, "players": [ { "pos": "1", "wd": "0", "dq": "0", "veknid": "3200164", "firstname": "**anonymized**", "lastname": "**anonymized**", "gw": "1", "vp": "4.5", "tp": "144", "tie": "165", "vpf": "2.0", "rtp": "165" }, { "pos": "2", "wd": "0", "dq": "0", "veknid": "8300035", "firstname": "**anonymized**", "lastname": "**anonymized**", "gw": "2", "vp": "5.0", "tp": "132", "tie": "0", "vpf": "0.5", "rtp": "82" }, { "pos": "2", "wd": "0", "dq": "0", "veknid": "3200307", "firstname": "**anonymized**", "lastname": "**anonymized**", "gw": "1", "vp": "4.5", "tp": "144", "tie": "70", "vpf": "0.0", "rtp": "70" }, { "pos": "2", "wd": "0", "dq": "0", "veknid": "3200372", "firstname": "**anonymized**", "lastname": "**anonymized**", "gw": "1", "vp": "4.0", "tp": "126", "tie": "0", "vpf": "0.0", "rtp": "68" }, { "pos": "2", "wd": "0", "dq": "0", "veknid": "3200292", "firstname": "**anonymized**", "lastname": "**anonymized**", "gw": "1", "vp": "7.5", "tp": "162", "tie": "0", "vpf": "0.5", "rtp": "84" }, { "pos": "6", "wd": "0", "dq": "0", "veknid": "3200272", "firstname": "**anonymized**", "lastname": "**anonymized**", "gw": "1", "vp": "4.0", "tp": "120", "tie": "0", "vpf": "0.0", "rtp": "29" }, ... { "pos": "21", "wd": "0", "dq": "0", "veknid": "3200376", "firstname": "**anonymized**", "lastname": "**anonymized**", "gw": "0", "vp": "0.0", "tp": "60", "tie": "0", "vpf": "0.0", "rtp": "5" }, { "pos": "22", "wd": "0", "dq": "0", "veknid": "3200339", "firstname": "**anonymized**", "lastname": "**anonymized**", "gw": "0", "vp": "0.0", "tp": "58", "tie": "0", "vpf": "0.0", "rtp": "5" }, { "pos": "23", "wd": "1", "dq": "0", "veknid": "3200347", "firstname": "**anonymized**", "lastname": "**anonymized**", "gw": "0", "vp": "0.0", "tp": "46", "tie": "0", "vpf": "0.0", "rtp": "5" } ] } ] } } 2.c) venue Returns the venue with a given id. GET https://www.vekn.net/api/vekn/venue/2847 { "err_msg": "", "err_code": "", "response_id": "634967cc7e933", "api": "vekn.venue", "version": "", "data": { "venues": [ { "name": "Troll2Jeux", "address": "15-17 Place d'Aligre", "notes": "5 minutes away by walk from the Gare de Lyon train station", "zip": "75012", "email": "", "phone": "01 43 40 90 46", "website": "https://www.facebook.com/Troll2jeux/", "city": "Paris", "country": "FR", "lat": "48.846863", "lng": "2.377387" } ] } } 2.d) seating Returns the optimal seatings for N rounds and P players, if available. The seating for the round 1 is always 1, 2, 3... P GET https://www.vekn.net/api/vekn/seating?rounds=3&players=10 { "err_msg": "", "err_code": "", "response_id": "5ed40b295a385", "api": "vekn.seating", "version": "", "data": { "r2": [ 8, 6, 2, 10, 1, 5, 9, 4, 7, 3 ], "r3": [ 10, 3, 9, 2, 8, 4, 1, 7, 5, 6 ], "rounds": 3, "players": 10 } } 2.e) archon POST https://www.vekn.net/api/vekn/archon/9955 Body must contain archondata = P: the number of players R: the number of rounds (including the final, so 3 for 2R+F, 4 for 3R+F, and so on) T: the total number of tables over the R rounds (+1 if a final round is played) = ¤{P} | ¤{P}¤{T} = §§§§§§§§§§§ = [0-9]{7} = 0 | 0.5 | 1 | 1.5 | 2 | 2.5 | 3 | 3.5 | 4 | 4.5 | 5 = \d+ = // empty string = 1 | 2 | [5..P] | = [0..R] = = = DQ | WD = estimated rating points (will be overwritten by the rating points batch)
= §(§§§){5}§ = [0..R] // 0 for the final round if any, the number of the round otherwise = 0 | // which player has received the GW (0 if none) = | = =