This repository has been archived by the owner on Jun 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver-requests.http
177 lines (136 loc) · 4.05 KB
/
server-requests.http
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
### Get sensor data sets vai plant id.
GET http://localhost:3333/v1/sensor-data?sensor=humidity&plant=1&from=2019-01-01T00:00:00.000Z&to=2023-05-20T00:00:00.000Z
Authorization: Basic a3J1c2U6SWxvdmVD
### Get sensor data sets via plantGroup id.
GET http://localhost:3333/v1/sensor-data?sensor=temperature&plantGroup=2&from=2019-01-01T00:00:00.000Z&to=2023-06-20T00:00:00.000Z
Authorization: Basic a3J1c2U6SWxvdmVD
### Save a new sensor data set.
POST http://localhost:3333/v1/sensor-data
Authorization: Basic a3J1c2U6SWxvdmVD
Content-Type: application/json
{
"data": [
{
"controller": "a955f72e-1e90-492f-bc62-a2145dd39f38",
"sensor": "temperature",
"value": 20.7
}
]
}
### Get a single plant.
GET http://localhost:3333/v1/plant/1
Authorization: Basic a3J1c2U6SWxvdmVD
### Create a new plant.
POST http://localhost:3333/v1/plant
Authorization: Basic a3J1c2U6SWxvdmVD
Content-Type: application/json
{
"name": "testplant-3",
"description": "testplant",
"plantGroupId": 1,
"species": "Test Plant",
"location": "Das andere Fenster",
"additionalCareTips": ["Wasser geben", "Düngen"]
}
### Update a plant.
PUT http://localhost:3333/v1/plant/3
Authorization: Basic a3J1c2U6SWxvdmVD
Content-Type: application/json
{
"name": "testplant-3",
"description": "testplant that has been modified",
"plantGroupId": 1,
"Species": "Test Plant",
"Location": "Das andere Fenster",
"additionalCareTips": ["Wasser geben", "Düngen", "Liebe geben"]
}
### Delete a plant.
DELETE http://localhost:3333/v1/plant/4
Authorization: Basic a3J1c2U6SWxvdmVD
### Get all plant IDs.
GET http://localhost:3333/v1/plants
Authorization: Basic a3J1c2U6SWxvdmVD
### Get all plant-stubs.
GET http://localhost:3333/v1/plants/overview
Authorization: Basic a3J1c2U6SWxvdmVD
### Get all plants in a plant group.
GET http://localhost:3333/v1/plants?plantGroupId=1
Authorization: Basic a3J1c2U6SWxvdmVD
### Get a single plant group.
GET http://localhost:3333/v1/plant-group/1
Authorization: Basic a3J1c2U6SWxvdmVD
### Create a plant group.
POST http://localhost:3333/v1/plant-group
Authorization: Basic a3J1c2U6SWxvdmVD
{
"name": "Cactaceae",
"description": "Mein kleiner grüner Kaktus",
"careTips": [],
"sensorRanges": [
{
"sensor": "humidity",
"min": 40,
"max": 60
}
]
}
### Update a plant group.
PUT http://localhost:3333/v1/plant-group/1
Authorization: Basic a3J1c2U6SWxvdmVD
{
"name": "Cactaceae",
"description": "Mein kleiner grüner Kaktus",
"careTips": [],
"sensorRanges": [
{
"sensor": "humidity",
"min": 40,
"max": 60
}
]
}
### Delete a plant group.
DELETE http://localhost:3333/v1/plant-group/1
Authorization: Basic a3J1c2U6SWxvdmVD
### Get all plant group IDs.
GET http://localhost:3333/v1/plant-groups
Authorization: Basic a3J1c2U6SWxvdmVD
### Get all plant group stubs.
GET http://localhost:3333/v1/plant-groups/overview
Authorization: Basic a3J1c2U6SWxvdmVD
### Get all sensor types.
GET http://localhost:3333/v1/sensor-types
Authorization: Basic a3J1c2U6SWxvdmVD
### Get a single controller.
GET http://localhost:3333/v1/controller/a955f72e-1e90-492f-bc62-a2145dd39f38
Authorization: Basic a3J1c2U6SWxvdmVD
### Login a user. Returns the corresponding user.
GET http://localhost:3333/v1/user/login
Authorization: Basic a3J1c2U6SWxvdmVD
### Get all users.
GET http://localhost:3333/v1/users
Authorization: Basic cm9vdDpyb290
### Get a single user.
GET http://localhost:3333/v1/user/7
Authorization: Basic cm9vdDpyb290
### Create a new user.
POST http://localhost:3333/v1/user
Authorization: Basic cm9vdDpyb290
Content-Type: application/json
{
"name": "testuser42",
"password": "1234",
"role": 1
}
### Update a user.
PUT http://localhost:3333/v1/user/7
Authorization: Basic cm9vdDpyb290
Content-Type: application/json
{
"name": "testuser42",
"password": "123456",
"role": 1
}
### Delete a user.
DELETE http://localhost:3333/v1/user/7
Authorization: Basic cm9vdDpyb290