πŸ“„
Docs
  • πŸ’»Gateway Server and API Docs
  • πŸ“”Client-Side Helper Functions
  • πŸ—ΊοΈMapping
  • πŸ””Notifications
  • 😎HoloLens
  • πŸ› οΈTSS Utility Routes
  • πŸ§ͺTest Routes
Powered by GitBook
On this page
  • Get Requests
  • /api/v0?get=todo
  • /api/v0?get=warning
  • Post Requests
  • Update Todo
  • Update Warning

Notifications

Documentation for Notification Control in the Map API

Please work with the assumption that the requests and json python libraries have been imported for all examples below

Get Requests

The Gateway Notification System allows for two ways to get notification data

/api/v0?get=todo

  • Gets a list of todo items from the API

response = requests.get('http://[IP]:3001/api/v0?get=todo')
todo_items = json.loads(response.text)["todoItems"]

print(todo_items)
    
# prints in the format 
# [ ["Todo Item Name 1", "True"], ["Todo Item Name 2", "False] ]
# where "True implies task completed and "False" implies task not completed 

/api/v0?get=warning

response = requests.get('http://[IP]:3001/api/v0?get=warning')
warning = json.loads(response.text)["infoWarning"]

print(warning) 

# prints in the format 
# "Warning Message"
# where that is the message set by the LMCC frontend 

Post Requests

The Gateway Notification System allows for certain ways to set notification data. This can be done with either the Client-Side Helper Functions or in a standalone manner.

Update Todo

data = {
    "notif": "update_todo"
    "todoItems": [ ["Do Task 1", "False"], ["Do Task 2", "True"] ] 

response = requests.get(
    'http://[IP]/api/v0'
    headers={'Content-Type': 'application/json'}
    data=data
    )
    
# this will update the ./server/data/todo.json to be 
# { 
#     "todoItems": [ 
#         ["Do Task 1", "False"], 
#         ["Do Task 2", "True"]
#        ]
# } 

Update Warning

data = {
    "notif": "update_warning"
    "infoWarning": "Warning Item"

response = requests.get(
    'http://[IP]/api/v0'
    headers={'Content-Type': 'application/json'}
    data=data
    )
    
# this will update the ./server/data/warning.json to be 
# { 
#     "infoWarning": "Warning Item"
# } 
PreviousMappingNextHoloLens

Last updated 1 year ago

πŸ””