-
Notifications
You must be signed in to change notification settings - Fork 0
Formation API
Liam Boudadi edited this page Feb 5, 2025
·
19 revisions
GET / (gets all in-memory formations details)
None
http code content-type response 200json[{"id": {int}, "name": {string}, "description": {string}}, ...]
curl -L -X GET 'http://localhost:8080/formation/formations' -H 'Authorization: Bearer {jwt}'
GET /{formationId} (gets details about the formation requested)
name type data type description formationId required int The specific formation id
http code content-type response 200json{"id": {int}, "name": {string}, "description": {string}}404N/A
curl -L -X GET 'http://localhost:8080/formation/{formationId}' -H 'Authorization: Bearer {jwt}'
GET / (gets all in-memory quizzes details)
None
http code content-type response 200json[{"id": {int}, "json": {string}}, ...]
curl -L -X GET 'http://localhost:8080/formation/quizzes' -H 'Authorization: Bearer {jwt}'
GET /{quizId} (gets details about the quiz requested)
name type data type description quizId required int The specific quiz id
http code content-type response 200json{"id": {int}, "json": {string}}404N/A N/A
curl -L -X GET 'http://localhost:8080/formation/quiz/{quizId}' -H 'Authorization: Bearer {jwt}'
GET / (gets all the quiz scores of the connected user)
None
http code content-type response 200json[{"userEmail": {string}, "quizId": {int}, "score": {float}}, ...] 404N/A N/A
curl -L -X GET 'http://localhost:8080/formation/quizzes/scores' -H 'Authorization: Bearer {jwt}'
GET /{quizId} (gets the selected quiz score of the connected user)
name type data type description quizId required int The specific quiz id
http code content-type response 200floatThe corresponding float 404N/A N/A
curl -L -X GET 'http://localhost:8080/formation/quiz/score/{quizId}' -H 'Authorization: Bearer {jwt}'
GET / (gets all in-memory videos details)
None
http code content-type response 200json[{"id": {int}, "title": {string}, "description": {string}, "url": {string}}, ...]
curl -L -X GET 'http://localhost:8080/formation/videos' -H 'Authorization: Bearer {jwt}'
POST /{quiId} (set the score of the selected quiz for the connected user)
name type data type description quizId required int The specific quiz id
http code content-type response 200string Score saved successfully 500string Error saving score 400json{"timestamp": {string}, "status": 400, "error": "Bad Request", "path": "/formation/quiz/score"}
curl -L -X POST "http://localhost:8080/formation/quiz/score" -H "Authorization: Bearer {jwt}" -H "Content-Type: application/json" --data-raw "{\"userEmail\": \"email.test@gmail.com\",\"quizId\": 1,\"score\": 2}"