CANNELO, cannist ranking
 

 

Page en cours de développement...

Description de l'API

Cannelo possède une API qui permet de récupérer des informations depuis un autre site Web ou de communiquer à l'application la création d'un événement, les résultats d'un match ou la mise à jour de données d'un tireur.

De plus, les informations transittant par l'API suivent le standard JWT. Veillez donc bien à respecter les normes de ce standard pour que tout fonctionne correctement. Pour plus d'informations, consulter https://jwt.io.

L'entête (header) JWT sera toujours la même car elle ne nécessite pas de varier. A ce propos, seul le cryptage sha256 est supporté par l'API.

Le corps (payload) JWT devra contenir toutes les informations nécessaires au serveur pour vous renvoyer les informations (voir ci-après). Dans la plupart des cas, une erreur vous sera renvoyée au format JSON (non crypté) pour faciliter le débugage.

Rappel : la signature du token JWT devra être cryptée avec l'algorithme sha256 avec la clé que nous vous aurons fournie.

Event

CREATE

{"id":"event_id","short_name":"a small name for the event. Ex : INTX17 for \"Internationaux de France 2017\"","full_name":"the complete name of the event","dates":"the starting and ending date of the event, written like this : 2018-07-31|2018-08-01","location":"the location where the event takes place"}

READ

{"id":"event_id","short_name":"a small name for the event. Ex : INTX17 for \"Internationaux de France 2017\"","full_name":"the complete name of the event","dates":"the starting and ending date of the event, written like this : 2018-07-31|2018-08-01","location":"the location where the event takes place"}

READ ONE

{"id":"event_id","short_name":"a small name for the event. Ex : INTX17 for \"Internationaux de France 2017\"","full_name":"the complete name of the event","dates":"the starting and ending date of the event, written like this : 2018-07-31|2018-08-01","location":"the location where the event takes place"}

UPDATE

{"id":"event_id","short_name":"a small name for the event. Ex : INTX17 for \"Internationaux de France 2017\"","full_name":"the complete name of the event","dates":"the starting and ending date of the event, written like this : 2018-07-31|2018-08-01","location":"the location where the event takes place"}

Fighter

CREATE

{"first_name":"first name of the fighter, normally all letters should fit","last_name":"last name of the fighter, normally all letters should fit","birth_date":"format of the date : YY-MM-DD","license":"the license number of the fighter. If you don't know, a number greater than 8000000","gender":"m or f"}

READ

{"first_name":"first name of the fighter, normally all letters should fit","last_name":"last name of the fighter, normally all letters should fit","birth_date":"format of the date : YY-MM-DD","license":"the license number of the fighter. If you don't know, a number greater than 8000000","gender":"m or f"}

READ ONE

{"first_name":"first name of the fighter, normally all letters should fit","last_name":"last name of the fighter, normally all letters should fit","birth_date":"format of the date : YY-MM-DD","license":"the license number of the fighter. If you don't know, a number greater than 8000000","gender":"m or f"}

UPDATE

{"first_name":"first name of the fighter, normally all letters should fit","last_name":"last name of the fighter, normally all letters should fit","birth_date":"format of the date : YY-MM-DD","license":"the license number of the fighter. If you don't know, a number greater than 8000000","gender":"m or f"}

Team

CREATE

{"name":"the team name, normally all letters should fit","teammates":"the ids of the teammates, with the format : \"id1, id2, id3\""}

READ

{"name":"the team name, normally all letters should fit","teammates":"the ids of the teammates, with the format : \"id1, id2, id3\""}

READ ONE

{"name":"the team name, normally all letters should fit","teammates":"the ids of the teammates, with the format : \"id1, id2, id3\""}

UPDATE

{"name":"the team name, normally all letters should fit","teammates":"the ids of the teammates, with the format : \"id1, id2, id3\""}

Match

CREATE

{"p1_id":"id of the first fighter\/team","p2_id":"id of the second fighter\/team","p1_score":"score of the first fighter\/team","p2_score":"score of the second fighter\/team","date":"date of the match, format : YY-MM-DD","type":"the type of the match : \"team\" or \"indiv\"","code_group":"the group code (see : CODES)","code_phase":"the phase code (see : CODES)","code_category":"the category code (see : CODES)","event_id":"the id of the event","match_number":"the match number, according to the event"}

READ

{"p1_id":"id of the first fighter\/team","p2_id":"id of the second fighter\/team","p1_score":"score of the first fighter\/team","p2_score":"score of the second fighter\/team","date":"date of the match, format : YY-MM-DD","type":"the type of the match : \"team\" or \"indiv\"","code_group":"the group code (see : CODES)","code_phase":"the phase code (see : CODES)","code_category":"the category code (see : CODES)","event_id":"the id of the event","match_number":"the match number, according to the event"}

READ ONE

{"p1_id":"id of the first fighter\/team","p2_id":"id of the second fighter\/team","p1_score":"score of the first fighter\/team","p2_score":"score of the second fighter\/team","date":"date of the match, format : YY-MM-DD","type":"the type of the match : \"team\" or \"indiv\"","code_group":"the group code (see : CODES)","code_phase":"the phase code (see : CODES)","code_category":"the category code (see : CODES)","event_id":"the id of the event","match_number":"the match number, according to the event"}

UPDATE

{"p1_id":"id of the first fighter\/team","p2_id":"id of the second fighter\/team","p1_score":"score of the first fighter\/team","p2_score":"score of the second fighter\/team","date":"date of the match, format : YY-MM-DD","type":"the type of the match : \"team\" or \"indiv\"","code_group":"the group code (see : CODES)","code_phase":"the phase code (see : CODES)","code_category":"the category code (see : CODES)","event_id":"the id of the event","match_number":"the match number, according to the event"}