{"swagger":"2.0","info":{"description":"API of our Acrobat project called \"8fit Challenge\"\nThis is the final version of it\n[Site web](http://8fit.fr) \n","version":"2.0.0","title":"8fit Challenge"},"tags":[{"name":"login","description":"methods to log the user in/out and get the infos"},{"name":"challenges","description":"Everything about the challenges"},{"name":"user","description":"Operations about user"},{"name":"point","description":"operation about the map points"},{"name":"session","description":"operation about the differernt sport sessions"}],"paths":{"/challenges":{"post":{"tags":["challenges"],"summary":"Add a challenge","operationId":"addChallenge","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"body","description":"Challegne complet à ajouter","required":true,"schema":{"$ref":"#/definitions/Challenge"}}],"responses":{"200":{"description":"operation succesfull"}}},"get":{"tags":["challenges"],"summary":"Get all the challenges","operationId":"getAllChallenges","produces":["application/json"],"responses":{"200":{"description":"succesfull operation","schema":{"$ref":"#/definitions/AllChallenges"}},"400":{"description":"Invalid ID supplied"},"404":{"description":"Challenge not found"}}}},"/challenges/{id}":{"get":{"tags":["challenges"],"summary":"Get a single challenge with his id","operationId":"getOneChallenge","produces":["application/json"],"parameters":[{"name":"id","in":"path","description":"id of the challenge","required":true,"type":"integer"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/Challenge"}},"400":{"description":"Invalid id supplied"},"404":{"description":"challenge not found"}}},"put":{"tags":["challenges"],"summary":"Update a challenge with his id","operationId":"updateChallenge","produces":["application/json"],"parameters":[{"name":"id","in":"path","description":"id of the challenge","required":true,"type":"integer"},{"name":"challenge","in":"body","description":"data of the challenge to update","required":true,"schema":{"$ref":"#/definitions/Challenge"}}],"responses":{"200":{"description":"successful operation"},"400":{"description":"Invalid id supplied"},"404":{"description":"challenge not found"}}},"delete":{"tags":["challenges"],"summary":"Delete a single challenge with his id","operationId":"deleteOneChallenge","produces":["application/json"],"parameters":[{"name":"id","in":"path","description":"id of the challenge","required":true,"type":"integer"}],"responses":{"200":{"description":"successful operation"},"400":{"description":"Invalid id supplied"},"404":{"description":"challenge not found"}}}},"/challenges/{id}/publish":{"put":{"tags":["challenges"],"summary":"Join a challeng","operationId":"joinChallenge","parameters":[{"name":"id","in":"path","description":"id of the challenge","required":true,"type":"integer"}],"responses":{"200":{"description":"successful operation"},"404":{"description":"Invalid Id supplied"},"417":{"description":"Challenge is not valid"}}}},"/challenges/{id}/join":{"put":{"tags":["challenges"],"summary":"make the user join a challenge","operationId":"JoinChallenge","parameters":[{"name":"id","in":"path","description":"id of the challenge","required":true,"type":"integer"}],"responses":{"200":{"description":"successful operation"},"400":{"description":"Invalid id supplied"},"404":{"description":"challenge not found"}}}},"/challenges/{id}/activate":{"put":{"tags":["challenges"],"summary":"make the challenge active by default","operationId":"activateChallenge","parameters":[{"name":"id","in":"path","description":"id of the challenge","required":true,"type":"integer"}],"responses":{"200":{"description":"successful operation"},"400":{"description":"Invalid id supplied"},"404":{"description":"challenge not found"}}}},"/challenges/{id}/points":{"get":{"tags":["challenges","point"],"summary":"get all points from a challenge","operationId":"getChallengePoints","parameters":[{"name":"id","in":"path","description":"id of the challenge","required":true,"type":"integer"}],"responses":{"200":{"description":"successful operation"},"400":{"description":"Invalid id supplied"},"404":{"description":"challenge not found"}}},"post":{"tags":["challenges","point"],"summary":"set up the points from a challenge","operationId":"createPoints","parameters":[{"name":"id","in":"path","description":"id of the challenge","required":true,"type":"integer"},{"name":"points","in":"body","description":"all the points to store","required":true,"schema":{"$ref":"#/definitions/Points"}}],"responses":{"200":{"description":"successful operation"},"400":{"description":"Invalid id supplied"},"404":{"description":"challenge not found"}}}},"/sessions":{"get":{"tags":["session"],"summary":"get all the sessions","operationId":"getAllSession","responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/Session"}}}}},"/sessions/{id}":{"get":{"tags":["session"],"summary":"get all the sessions","operationId":"getAllSessions","parameters":[{"name":"id","in":"path","description":"id of the session","required":true,"type":"integer"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/Session"}},"404":{"description":"session not found"}}}},"/signup":{"post":{"tags":["user","login"],"summary":"Create user and log him in","description":"This can only be done by the logged in user.","operationId":"signup","produces":["application/json"],"parameters":[{"in":"body","name":"user","description":"Created user object","required":true,"schema":{"$ref":"#/definitions/UserLog"}}],"responses":{"default":{"description":"successful operation"}}}},"/signin":{"post":{"tags":["user","login"],"summary":"Logs user into the system","operationId":"loginUser","produces":["application/json"],"parameters":[{"in":"body","name":"user","description":"Created user object","required":true,"schema":{"$ref":"#/definitions/UserLog"}}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/User"}},"400":{"description":"Invalid username/password supplied"}}}},"/signout":{"get":{"tags":["user","login"],"summary":"Disconnect the current user","operationId":"signoutUser","produces":["application/json"],"responses":{"default":{"description":"successful operation"}}}},"/whoami":{"get":{"tags":["user","login"],"summary":"get the informations of the current user","operationId":"whoami","responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/User"}}}}},"/users":{"get":{"tags":["user"],"summary":"get all the users from the App","operationId":"getAllUsers","responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/Users"}}}}},"/users/{id}":{"get":{"tags":["user"],"summary":"get all the users from the App","operationId":"getUSer","parameters":[{"name":"id","in":"path","description":"id of the user","required":true,"type":"integer"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/User"}},"404":{"description":"invalid used id"}}},"put":{"tags":["user"],"summary":"edit a user","operationId":"editUser","parameters":[{"name":"id","in":"path","description":"id of the user","required":true,"type":"integer"}],"responses":{"200":{"description":"successful operation"},"404":{"description":"invalid used id"}}}},"/my/sessions":{"get":{"tags":["user","session"],"summary":"get all the session from the user, no matter the challenge","operationId":"getUsersSessions","responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/Sessions"}}}},"post":{"tags":["user","session"],"summary":"start a session","operationId":"startSession","parameters":[{"$ref":"#/definitions/Session"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/Session"}},"404":{"description":"no challenge sellected or another session is already running"}}},"put":{"tags":["user","session"],"summary":"edit a session","operationId":"updateSession","parameters":[{"$ref":"#/definitions/Session"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/Session"}},"404":{"description":"no challenge sellected or another session is already running"}}}},"/my/events":{"get":{"tags":["user","challenges","event"],"summary":"get all the event from the current loged user, from the selected challenge","operationId":"getAllMyEvent","responses":{"200":{"description":"successful operation"},"404":{"description":"no challenge selected"}}}},"/my/points/{id}/reach":{"put":{"tags":["user","challenges","point"],"summary":"reach a certain point in the current selected challenge","operationId":"reachPoint","parameters":[{"name":"id","in":"path","type":"integer","required":true}],"responses":{"200":{"description":"successful operation"},"404":{"description":"no selected challenge or point doesn't exist"}}}},"/my/points/{id}/answer":{"put":{"tags":["user","challenges","point"],"summary":"send the answer to a question","parameters":[{"name":"id","in":"path","type":"integer","required":true},{"name":"answer","in":"body","schema":{"type":"integer"},"required":true}],"responses":{"200":{"description":"answer registered for the question"},"404":{"description":"non existing point"}}}},"/my/challenges/{id}/sessions":{"get":{"tags":["user","challenges","session"],"summary":"Return all the sessions from the logged user for a specific challenge","parameters":[{"name":"id","in":"path","type":"integer","required":true}],"responses":{"200":{"description":"successful operartion","schema":{"$ref":"#/definitions/Sessions"}},"404":{"description":"challenge doesn't exist or not followed"}}}},"/my/challenges/joined":{"get":{"tags":["user","challenges"],"summary":"Return all the joined challenges for the current logged user","responses":{"200":{"description":"successful operartion"}}}},"/my/challenges/created":{"get":{"tags":["user","challenges"],"summary":"Return all the created challenge by the logged user","responses":{"200":{"description":"successful operation"}}}},"/my/statistiques/month":{"get":{"tags":["user"],"summary":"get the statistiques from the last 30 days","responses":{"200":{"description":"successful operartion","schema":{"$ref":"#/definitions/ArrayStatsMonth"}}}}},"/my/statistiques/year":{"get":{"tags":["user"],"summary":"get the distance per month of the current year","responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/ArrayStatsYear"}}}}}},"definitions":{"Challenge":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"description":{"type":"string"},"scale":{"type":"integer"},"thumbnailImageName":{"type":"string"},"mapImageName":{"type":"string"}}},"AllChallenges":{"type":"array","items":{"$ref":"#/definitions/Challenge"}},"StatistiquesMonth":{"type":"object","properties":{"day":{"type":"string"},"distance":{"type":"integer"}}},"ArrayStatsMonth":{"type":"array","items":{"$ref":"#/definitions/StatistiquesMonth"}},"StatistiquesYear":{"type":"object","properties":{"month":{"type":"string"},"distance":{"type":"integer"}}},"ArrayStatsYear":{"type":"array","items":{"$ref":"#/definitions/StatistiquesYear"}},"Point":{"type":"object","properties":{"id":{"type":"integer"},"longitude":{"type":"integer"},"latitude":{"type":"integer"},"adjacentLines":{"type":"array","items":{"$ref":"#/definitions/Line"}}}},"Points":{"type":"array","items":{"$ref":"#/definitions/Point"}},"CheckPoint":{"allOf":[{"$ref":"#/definitions/Point"},{"type":"object"},{"properties":{"challenge":{"$ref":"#/definitions/Challenge"}}}]},"ObstaclePoint":{"type":"object","properties":{"line":{"$ref":"#/definitions/Line"}}},"Line":{"type":"object","properties":{"id":{"type":"integer"},"points":{"type":"array","items":{"$ref":"#/definitions/Point"},"minItems":2,"maxItems":2}}},"User":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"username":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"},"phone":{"type":"string"},"userStatus":{"type":"integer","format":"int32","description":"User Status"}}},"Users":{"type":"array","items":{"$ref":"#/definitions/User"}},"UserLog":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"}}},"Event":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string","description":"must be a date"},"user":{"$ref":"#/definitions/User"},"challenge":{"$ref":"#/definitions/Challenge"}}},"CheckPointEvent":{"type":"object","allOf":[{"$ref":"#/definitions/Event"},{"type":"object"},{"properties":{"checkpoint":{"$ref":"#/definitions/CheckPoint"}}}]},"ObstaclePointEvent:":{"type":"object","allOf":[{"$ref":"#/definitions/Event"},{"type":"object"},{"properties":{"obstaclePoint":{"$ref":"#/definitions/ObstaclePoint"}}}]},"Session":{"type":"object","properties":{"id":{"type":"string"},"startDate":{"type":"string","description":"must be a date"},"endDate":{"type":"string","description":"must be a date"},"distance":{"type":"number"},"duration":{"type":"number"},"speed":{"type":"number"},"steps":{"type":"string"},"calories":{"type":"number"},"user":{"$ref":"#/definitions/User"},"challenge":{"$ref":"#/definitions/Challenge"}}},"Sessions":{"type":"array","items":{"$ref":"#/definitions/Session"}}},"externalDocs":{"description":"Find out more about Swagger","url":"http://swagger.io"},"host":"virtserver.swaggerhub.com","basePath":"/8fit/8fit_api/2.0.0","schemes":["https","http"]}