-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequests.http
More file actions
115 lines (94 loc) · 2.15 KB
/
requests.http
File metadata and controls
115 lines (94 loc) · 2.15 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
@baseUrl = https://coders-camp-schronisko.herokuapp.com/api
### Get all animals
GET {{baseUrl}}/animals
### Get animal
GET {{baseUrl}}/animals/1
### Register user
# @name register
POST {{baseUrl}}/users
Content-Type: application/json
{
"name": "Testowy",
"surname": "Uytkownik",
"phone": 123456789,
"repPassword": "ZAQ!2wsx",
"password": "ZAQ!2wsx",
"mail": "new.user@gmail.com",
"birthDate": "2000-12-30"
}
### uuid
@uuid = {{register.response.body.uuid}}
### Activate user
GET {{baseUrl}}/users/activate/{{uuid}}
### Login user
# @name login
POST {{baseUrl}}/users/auth
Content-Type: application/json
{
"mail": "new.user@gmail.com",
"password": "ZAQ!2wsx"
}
### Login admin
# @name adminLogin
POST {{baseUrl}}/users/auth
Content-Type: application/json
{
"mail": "admin@admin.com",
"password": "ZAQ!2wsx"
}
### Auth token
@authToken = {{login.response.body.apiKey}}
@adminToken = {{adminLogin.response.body.apiKey}}
### Get adoption form
GET {{baseUrl}}/forms/2
access_token: {{authToken}}
### Post adoption form
POST {{baseUrl}}/submissions/animals/add
access_token: {{authToken}}
Content-Type: application/json
{
"animalId": 2,
"stepNumber": 1,
"answers": [
{
"questionId": 3,
"answer": {
"type": "checkbox",
"answer": "Tak"
}
},
{
"questionId": 4,
"answer": {
"type": "checkbox",
"answer": "Nie"
}
}
]
}
### Get submissions in progress
GET {{baseUrl}}/submissions/animals?status=in+progress
access_token: {{adminToken}}
### Accept submission
PUT {{baseUrl}}/submissions/animals/change
access_token: {{adminToken}}
Content-Type: application/json
{
"status": "accepted",
"submissionId": 4
}
### Get accpeted submissions
GET {{baseUrl}}/submissions/animals?status=accepted
access_token: {{adminToken}}
### Add meeting
POST {{baseUrl}}/calendars
access_token: {{authToken}}
Content-Type: application/json
{
"date": "2021-03-21",
"animalId": 2,
"userId": 6
}
### Get meetings
GET {{baseUrl}}/calendars
access_token: {{adminToken}}