-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequests.http
More file actions
138 lines (100 loc) · 2.79 KB
/
requests.http
File metadata and controls
138 lines (100 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# SMARTRANKING API REQUESTS
## VARIABLES
@apiurl = http://localhost:3001
################## PLAYERS RELATED ##################
@playerId = 69b7626c1db34eaf13a1cfd4
### GET PLAYERS
GET {{apiurl}}/api/v1/players
### CREATE PLAYER
POST {{apiurl}}/api/v1/players
Content-Type: application/json
{
"name": "Player Name 2",
"email": "player2@example.com",
"phoneNumber": "1234567892"
}
### GET PLAYER BY ID
GET {{apiurl}}/api/v1/players/{{playerId}}
### UPDATE PLAYER BY ID
PUT {{apiurl}}/api/v1/players/{{playerId}}
Content-Type: application/json
{
"name": "Updated Player Name",
"email": "updatedplayer@example.com",
"phoneNumber": "0987654321"
}
### DELETE PLAYER BY ID
DELETE {{apiurl}}/api/v1/players/{{playerId}}
#####################################################
################## CATEGORIES RELATED ##################
@categoryId = 69ba14e934ccd240cac43ff5
### GET CATEGORIES
GET {{apiurl}}/api/v1/categories
### CREATE CATEGORY
POST {{apiurl}}/api/v1/categories
Content-Type: application/json
{
"name": "Category Name",
"description": "Category Description",
"events":[{
"name":"party"
}]
}
### ASSIGN PLAYER TO CATEGORY
POST {{apiurl}}/api/v1/categories/{{categoryId}}/players/{{playerId}}
Content-Type: application/json
{
}
### GET CATEGORY BY ID
GET {{apiurl}}/api/v1/categories/{{categoryId}}
### UPDATE CATEGORY BY ID
PUT {{apiurl}}/api/v1/categories/{{categoryId}}
Content-Type: application/json
{
"name": "Updated Category Name",
"description": "Updated Category Description"
}
### DELETE CATEGORY BY ID
DELETE {{apiurl}}/api/v1/categories/{{categoryId}}
#####################################################
################## CHALLENGES RELATED ##################
@challengeId = 69ba155334ccd240cac4400b
@player1Id = 69b7626c1db34eaf13a1cfd4
@player2Id = 69b764e4a799ea41aa26960f
### CREATE CHALLENGE
POST {{apiurl}}/api/v1/challengers
Content-Type: application/json
{
"challengeDate": "2026-03-20T15:00:00Z",
"requester": { "_id": "{{player1Id}}" },
"players": [
{ "_id": "{{player1Id}}" },
{ "_id": "{{player2Id}}" }
]
}
### GET ALL CHALLENGES
GET {{apiurl}}/api/v1/challengers
### GET CHALLENGES BY PLAYER
GET {{apiurl}}/api/v1/challengers?playerId={{player1Id}}
### GET CHALLENGE BY ID
GET {{apiurl}}/api/v1/challengers/{{challengeId}}
### UPDATE CHALLENGE (Status/Date)
PUT {{apiurl}}/api/v1/challengers/{{challengeId}}
Content-Type: application/json
{
"status": "ACCEPTED"
}
### ASSIGN MATCH TO CHALLENGE (Result)
POST {{apiurl}}/api/v1/challengers/{{challengeId}}/match
Content-Type: application/json
{
"def": { "_id": "{{player1Id}}" },
"result": [
{ "set": "6-1" },
{ "set": "4-6" },
{ "set": "7-5" }
]
}
### DELETE CHALLENGE
DELETE {{apiurl}}/api/v1/challengers/{{challengeId}}
#####################################################