From 0860bef2345ba5d0ca275fbdcc7f7058b32f0c2d Mon Sep 17 00:00:00 2001 From: "narindra.rajohnso" <narindra-hasimanjaka-david.rajohnson@etu.hesge.ch> Date: Mon, 19 Jun 2023 14:12:00 +0200 Subject: [PATCH] add postman collection --- ...e_RAJOHNSON_JAQUET.postman_collection.json | 521 ++++++++++++++++++ 1 file changed, 521 insertions(+) create mode 100644 API_Quizz_Game_RAJOHNSON_JAQUET.postman_collection.json diff --git a/API_Quizz_Game_RAJOHNSON_JAQUET.postman_collection.json b/API_Quizz_Game_RAJOHNSON_JAQUET.postman_collection.json new file mode 100644 index 0000000..8162b68 --- /dev/null +++ b/API_Quizz_Game_RAJOHNSON_JAQUET.postman_collection.json @@ -0,0 +1,521 @@ +{ + "info": { + "_postman_id": "49fbecc8-f2eb-48fd-83a7-d6bc93e2ac4e", + "name": "API_Quizz_Game_RAJOHNSON_JAQUET", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "25046289" + }, + "item": [ + { + "name": "Invités", + "item": [ + { + "name": "Guest Create Account", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"username\": \"user1\",\n \"password\": \"qwertzuiop\",\n \"lastname\": \"user\",\n \"firstname\": \"un\",\n \"email\": \"user1@titu.ch\",\n \"accountType\": 0\n}" + }, + "url": { + "raw": "http://localhost:30992/api/v1/guests/users/", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "30992", + "path": [ + "api", + "v1", + "guests", + "users", + "" + ], + "query": [ + { + "key": "username", + "value": "test", + "disabled": true + }, + { + "key": "password", + "value": "sldfsdfds", + "disabled": true + }, + { + "key": "accountType", + "value": "1", + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "Guest Connect User", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"password\": \"qwertzuiop\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:30992/api/v1/guests/users/admin1", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "30992", + "path": [ + "api", + "v1", + "guests", + "users", + "admin1" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Utilisateurs", + "item": [ + { + "name": "Get user info(in game)", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoiYWRtaW4iLCJ1c2VybmFtZSI6ImFkbWluMSIsImZpcnN0bmFtZSI6InVuIiwibGFzdG5hbWUiOiJhZG1pbiIsImlhdCI6MTY4NjY1MTc5M30.kf00PdlQLPoAYmLxXhZiun-o5s1X0fysTp18TMeVIsA", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "http://localhost:30992/api/v1/users/admin1", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "30992", + "path": [ + "api", + "v1", + "users", + "admin1" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Administrateurs", + "item": [ + { + "name": "Gestion d'utilisateurs", + "item": [ + { + "name": "List users", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoiYWRtaW4iLCJ1c2VybmFtZSI6ImFkbWluMSIsImZpcnN0bmFtZSI6InVuIiwibGFzdG5hbWUiOiJhZG1pbiIsImlhdCI6MTY4NjU3MzcyOX0.OKw1SIjSnIIoEYbLfe21jF9GOJmo7TbSnDBKugpgaWs", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "http://localhost:30992/api/v1/admins/admin1/users", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "30992", + "path": [ + "api", + "v1", + "admins", + "admin1", + "users" + ] + } + }, + "response": [] + }, + { + "name": "Create New User", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoiYWRtaW4iLCJ1c2VybmFtZSI6ImFkbWluMSIsImZpcnN0bmFtZSI6InVuIiwibGFzdG5hbWUiOiJhZG1pbiIsImlhdCI6MTY4NjU3MzcyOX0.OKw1SIjSnIIoEYbLfe21jF9GOJmo7TbSnDBKugpgaWs", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"username\": \"new78\",\n \"password\": \"k3nregn\",\n \"lastname\": \"rajohn\",\n \"firstname\": \"dav\",\n \"email\": \"test@titu.ch\",\n \"accountType\": 0\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:30992/api/v1/admins/admin1/users", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "30992", + "path": [ + "api", + "v1", + "admins", + "admin1", + "users" + ] + } + }, + "response": [] + }, + { + "name": "Update User", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoiYWRtaW4iLCJ1c2VybmFtZSI6ImFkbWluMSIsImZpcnN0bmFtZSI6InVuIiwibGFzdG5hbWUiOiJhZG1pbiIsImlhdCI6MTY4NjU3MzcyOX0.OKw1SIjSnIIoEYbLfe21jF9GOJmo7TbSnDBKugpgaWs", + "type": "string" + } + ] + }, + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"accountType\": 0\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:30992/api/v1/admins/admin1/users/johndoe74", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "30992", + "path": [ + "api", + "v1", + "admins", + "admin1", + "users", + "johndoe74" + ] + } + }, + "response": [] + }, + { + "name": "Delete User", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoiYWRtaW4iLCJ1c2VybmFtZSI6ImFkbWluMSIsImZpcnN0bmFtZSI6InVuIiwibGFzdG5hbWUiOiJhZG1pbiIsImlhdCI6MTY4NjU3MzcyOX0.OKw1SIjSnIIoEYbLfe21jF9GOJmo7TbSnDBKugpgaWs", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:30992/api/v1/admins/users/new78", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "30992", + "path": [ + "api", + "v1", + "admins", + "users", + "new78" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Gestions des questions", + "item": [ + { + "name": "List questions", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoiYWRtaW4iLCJ1c2VybmFtZSI6ImFkbWluMSIsImZpcnN0bmFtZSI6InVuIiwibGFzdG5hbWUiOiJhZG1pbiIsImlhdCI6MTY4NjU3MzcyOX0.OKw1SIjSnIIoEYbLfe21jF9GOJmo7TbSnDBKugpgaWs", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "http://localhost:30992/api/v1/admins/admin1/list-questions", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "30992", + "path": [ + "api", + "v1", + "admins", + "admin1", + "list-questions" + ] + } + }, + "response": [] + }, + { + "name": "Create New Question", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoiYWRtaW4iLCJ1c2VybmFtZSI6ImFkbWluMSIsImZpcnN0bmFtZSI6InVuIiwibGFzdG5hbWUiOiJhZG1pbiIsImlhdCI6MTY4NjU3MzcyOX0.OKw1SIjSnIIoEYbLfe21jF9GOJmo7TbSnDBKugpgaWs", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"question\": \"Comment cela marche t-il?\",\n \"possibleResponse\": [\n \"Par télépathie\",\n \"A l'aveugle\",\n \"A l'aide de tes connaissances\"\n ],\n \"correctResponse\": 2,\n \"category\": \"Comment\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:30992/api/v1/admins/admin1/questions", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "30992", + "path": [ + "api", + "v1", + "admins", + "admin1", + "questions" + ] + } + }, + "response": [] + }, + { + "name": "Update Question", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoiYWRtaW4iLCJ1c2VybmFtZSI6ImFkbWluMSIsImZpcnN0bmFtZSI6InVuIiwibGFzdG5hbWUiOiJhZG1pbiIsImlhdCI6MTY4NjU3MzcyOX0.OKw1SIjSnIIoEYbLfe21jF9GOJmo7TbSnDBKugpgaWs", + "type": "string" + } + ] + }, + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"possibleResponse\": [\n \"Marc\",\n \"Joseph\",\n \"Richard\"\n ],\n \"correctResponse\": 1,\n \"category\": \"Nom\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:30992/api/v1/admins/admin1/questions/18", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "30992", + "path": [ + "api", + "v1", + "admins", + "admin1", + "questions", + "18" + ] + } + }, + "response": [] + }, + { + "name": "Delete Question", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoiYWRtaW4iLCJ1c2VybmFtZSI6ImFkbWluMSIsImZpcnN0bmFtZSI6InVuIiwibGFzdG5hbWUiOiJhZG1pbiIsImlhdCI6MTY4NjU3MzcyOX0.OKw1SIjSnIIoEYbLfe21jF9GOJmo7TbSnDBKugpgaWs", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:30992/api/v1/admins/admin1/questions/18", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "30992", + "path": [ + "api", + "v1", + "admins", + "admin1", + "questions", + "18" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Get admin info", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoiYWRtaW4iLCJ1c2VybmFtZSI6ImFkbWluMSIsImZpcnN0bmFtZSI6InVuIiwibGFzdG5hbWUiOiJhZG1pbiIsImlhdCI6MTY4NjU3MzcyOX0.OKw1SIjSnIIoEYbLfe21jF9GOJmo7TbSnDBKugpgaWs", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "", + "type": "text", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:30992/api/v1/admins/admin1", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "30992", + "path": [ + "api", + "v1", + "admins", + "admin1" + ] + } + }, + "response": [] + } + ] + } + ] +} \ No newline at end of file -- GitLab