You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: services/question/README.md
+23-23Lines changed: 23 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ This endpoint allows the retrieval of all the questions in the database. If filt
31
31
that matches with parameters will be returned; if no parameters are provided, all questions will be returned.
32
32
33
33
-**HTTP Method**: `GET`
34
-
-**Endpoint**: `/api/question`
34
+
-**Endpoint**: `/api/question/questions`
35
35
36
36
#### Parameters:
37
37
@@ -51,25 +51,25 @@ that matches with parameters will be returned; if no parameters are provided, al
51
51
52
52
```
53
53
Retrieve all Questions:
54
-
curl -X GET http://localhost:8081/api/question
54
+
curl -X GET http://localhost:8081/api/question/questions
55
55
56
56
Retrieve Questions by Title:
57
-
curl -X GET "http://localhost:8081/api/question?title=Reverse%20a%20String"
57
+
curl -X GET "http://localhost:8081/api/question/questions?title=Reverse%20a%20String"
58
58
59
59
Retrieve Questions by Description:
60
-
curl -X GET "http://localhost:8081/api/question?description=string"
60
+
curl -X GET "http://localhost:8081/api/question/questions?description=string"
61
61
62
62
Retrieve Questions by Topics:
63
-
curl -X GET "http://localhost:8081/api/question?topics=Algorithms,Data%20Structures"
63
+
curl -X GET "http://localhost:8081/api/question/questions?topics=Algorithms,Data%20Structures"
64
64
65
65
Retrieve Questions by Difficulty:
66
-
curl -X GET "http://localhost:8081/api/question?difficulty=Easy"
66
+
curl -X GET "http://localhost:8081/api/question/questions?difficulty=Easy"
67
67
68
68
Retrieve Questions by Title and Difficulty:
69
-
curl -X GET "http://localhost:8081/api/question?title=Reverse%20a%20String&difficulty=Easy"
69
+
curl -X GET "http://localhost:8081/api/question/questions?title=Reverse%20a%20String&difficulty=Easy"
70
70
71
71
Retrieve Questions by Title, Description, Topics, and Difficulty:
72
-
curl -X GET "http://localhost:8081/api/question?title=Reverse%20a%20String&description=string&topics=Algorithms&difficulty=Easy"
72
+
curl -X GET "http://localhost:8081/api/question/questions?title=Reverse%20a%20String&description=string&topics=Algorithms&difficulty=Easy"
73
73
```
74
74
75
75
#### Parameter Format Details:
@@ -117,7 +117,7 @@ encoding and readability concerns.
117
117
This endpoint allows the retrieval of the question by using the question ID.
118
118
119
119
-**HTTP Method**: `GET`
120
-
-**Endpoint**: `/api/question/{id}`
120
+
-**Endpoint**: `/api/question/questions/{id}`
121
121
122
122
#### Parameters:
123
123
@@ -135,7 +135,7 @@ This endpoint allows the retrieval of the question by using the question ID.
135
135
136
136
```
137
137
Retrieve Question by ID:
138
-
curl -X GET http://localhost:8081/api/question/1
138
+
curl -X GET http://localhost:8081/api/question/questions/1
139
139
```
140
140
141
141
#### Example of Response Body for Success:
@@ -165,7 +165,7 @@ curl -X GET http://localhost:8081/api/question/1
165
165
This endpoint allows the retrieval of random questions that matches the parameters provided.
166
166
167
167
-**HTTP Method**: `GET`
168
-
-**Endpoint**: `/api/question/search`
168
+
-**Endpoint**: `/api/question/questions/search`
169
169
170
170
#### Parameters:
171
171
@@ -187,10 +187,10 @@ This endpoint allows the retrieval of random questions that matches the paramete
187
187
188
188
```
189
189
Retrieve Random Question by Topics and Difficulty:
190
-
curl -X GET "http://localhost:8081/api/question/search?topics=Algorithms&difficulty=Medium"
190
+
curl -X GET "http://localhost:8081/api/question/questions/search?topics=Algorithms&difficulty=Medium"
191
191
192
192
Retrieve Random Question by Topics, Difficulty, and Limit:
193
-
curl -X GET "http://localhost:8081/api/question/search?topics=Algorithms,Data%20Structures&difficulty=Easy&limit=5"
193
+
curl -X GET "http://localhost:8081/api/question/questions/search?topics=Algorithms,Data%20Structures&difficulty=Easy&limit=5"
194
194
```
195
195
196
196
#### Example of Response Body for Success:
@@ -243,7 +243,7 @@ curl -X GET "http://localhost:8081/api/question/search?topics=Algorithms,Data%20
243
243
This endpoint retrieves all unique topics in the database
244
244
245
245
-**HTTP Method**: `GET`
246
-
-**Endpoint**: `/api/question/topics`
246
+
-**Endpoint**: `/api/question/questions/topics`
247
247
248
248
#### Responses:
249
249
@@ -256,7 +256,7 @@ This endpoint retrieves all unique topics in the database
256
256
257
257
```
258
258
Retrieve Topics:
259
-
curl -X GET http://localhost:8081/api/question/topics
259
+
curl -X GET http://localhost:8081/api/question/questions/topics
260
260
```
261
261
262
262
#### Example of Response Body for Success:
@@ -286,7 +286,7 @@ This endpoint allows the addition of a new question. The `id` is now automatical
286
286
uniqueness.
287
287
288
288
-**HTTP Method**: `POST`
289
-
-**Endpoint**: `/api/question`
289
+
-**Endpoint**: `/api/question/questions`
290
290
291
291
#### Request Body:
292
292
@@ -307,7 +307,7 @@ uniqueness.
307
307
308
308
```
309
309
Add Question:
310
-
curl -X POST http://localhost:8081/api/question -H "Content-Type: application/json" -d "{\"title\": \"New Question\", \"description\": \"This is a description for a new question.\", \"topics\": [\"Data Structures\", \"Algorithms\"], \"difficulty\": \"Medium\"}"
310
+
curl -X POST http://localhost:8081/api/question/questions -H "Content-Type: application/json" -d "{\"title\": \"New Question\", \"description\": \"This is a description for a new question.\", \"topics\": [\"Data Structures\", \"Algorithms\"], \"difficulty\": \"Medium\"}"
0 commit comments