1 files changed, 102 insertions, 15 deletions
diff --git a/endpoints.http b/endpoints.http
index aab693a..ce4c2d3 100644
--- a/endpoints.http
+++ b/endpoints.http
@@ -3,40 +3,74 @@
@password=admin
@email=admin@example.com
@userType=admin
+@accessToken=someValueXyzXyz
-GET {{baseUrl}}/budget/:id/add HTTP/1.1
-
-###
-# Get all users (raw)
-GET {{baseUrl}}/admin/users HTTP/1.1
+# Get all user IDs
+GET {{baseUrl}}/admin/allUserIds HTTP/1.1
Authorization: Bearer {{accessToken}}
###
-# Get a user (raw)
-GET {{baseUrl}}/admin/user/:id HTTP/1.1
+# Monitor all users
+POST {{baseUrl}}/admin/monitorAllUsers HTTP/1.1
Authorization: Bearer {{accessToken}}
###
-DELETE {{baseUrl}}/admin/user/:id HTTP/1.1
-
-###
-GET {{baseUrl}}/alarm/:id HTTP/1.1
+# Get the alarm for a monitored user, if one is set
+GET {{baseUrl}}/user/:id/alarm HTTP/1.1
+Authorization: Bearer {{accessToken}}
###
-PUT {{baseUrl}}/alarm/:id HTTP/1.1
+# Clear the alarm for a monitored user
+DELETE {{baseUrl}}/user/:id/alarm HTTP/1.1
+Authorization: Bearer {{accessToken}}
###
+# Get a list of all alarms for monitored users
GET {{baseUrl}}/alarms HTTP/1.1
+Authorization: Bearer {{accessToken}}
###
+# Get the current user's alarm
GET {{baseUrl}}/alarm/@me HTTP/1.1
+Authorization: Bearer {{accessToken}}
###
+# Raise an alarm (enum: one of "fall" or "toilet")
PUT {{baseUrl}}/alarm/@me HTTP/1.1
+Authorization: Bearer {{accessToken}}
+Content-Type: application/json
+
+{
+ "reason": "fall"
+}
+
###
+# Clear alarm
DELETE {{baseUrl}}/alarm/@me HTTP/1.1
+Authorization: Bearer {{accessToken}}
+
+###
+# Get assigned users
+GET {{baseUrl}}/monitor/assignedUsers HTTP/1.1
+Authorization: Bearer {{accessToken}}
+
+###
+# Add an assigned user by ID
+PATCH {{baseUrl}}/monitor/assignedUsers HTTP/1.1
+Authorization: Bearer {{accessToken}}
+Content-Type: application/json
+
+{
+ "userId": "abcdef"
+}
+
+
+###
+# Remove an assigned user by ID
+DELETE {{baseUrl}}/monitor/assignedUsers HTTP/1.1
+Authorization: Bearer {{accessToken}}
###
# Delete account
@@ -51,13 +85,27 @@ Content-Type: application/json
###
-GET {{baseUrl}}/budget/:id HTTP/1.1
+# Get the budget for a monitored user
+GET {{baseUrl}}/user/:id/budget HTTP/1.1
+Authorization: Bearer {{accessToken}}
###
-GET {{baseUrl}}/budget/@me HTTP/1.1
+# Add budget for a monitored user
+PATCH {{baseUrl}}/user/:id/budget HTTP/1.1
+Authorization: Bearer {{accessToken}}
+Content-Type: application/json
+
+{
+ "venue": "Monitor 123",
+ "reason": "Just short for a coke to deal with diabetes",
+ "amount": 0.15
+}
+
###
+# Get all devices registered to the user
GET {{baseUrl}}/auth/devices HTTP/1.1
+Authorization: Bearer {{accessToken}}
###
# Get the index page (empty)
@@ -76,11 +124,32 @@ Content-Type: application/json
###
-# Log out from a device (TODO)
+# Log out from a device
POST {{baseUrl}}/auth/logout HTTP/1.1
Authorization: Bearer {{accessToken}}
###
+# Get user device by ID
+GET {{baseUrl}}/auth/devices/:id HTTP/1.1
+Authorization: Bearer {{accessToken}}
+
+###
+# Delete user device by ID
+DELETE {{baseUrl}}/auth/devices/:id HTTP/1.1
+Authorization: Bearer {{accessToken}}
+
+###
+# Update user device by ID
+PATCH {{baseUrl}}/auth/devices/:id HTTP/1.1
+Authorization: Bearer {{accessToken}}
+Content-Type: application/json
+
+{
+ "name": "New Device Name"
+}
+
+
+###
# Create a new user
POST {{baseUrl}}/auth/register HTTP/1.1
Content-Type: application/json
@@ -98,7 +167,25 @@ Content-Type: application/json
GET {{baseUrl}}/status HTTP/1.1
###
+GET {{baseUrl}}/budget/@me HTTP/1.1
+Authorization: Bearer {{accessToken}}
+
+###
+# Spend part of budget
+PATCH {{baseUrl}}/budget/@me HTTP/1.1
+Authorization: Bearer {{accessToken}}
+Content-Type: application/json
+
+{
+ "venue": "The Store",
+ "reason": "Bought a coke",
+ "amount": 0.85
+}
+
+
+###
# Get current user
GET {{baseUrl}}/auth/whoami HTTP/1.1
+Authorization: Bearer {{accessToken}}
###
|