Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. * all dates show just the date format `yyyy-mm-ddThh:mm:ss.ffffff`
  2.  
  3. GET /api/v1.0/dashboard/{email}/{code}
  4.  
  5. Request: -
  6.  
  7. Response:
  8. {
  9.   // Message, that should be displayed on the top of the screen
  10.   // Click on this message will lead the user to the chosen type of measurement
  11.   // (according to situation)
  12.   //
  13.   // May be:
  14.   // - Update Measurement (no measurements for long time)
  15.   // - Congrats (some achievements)
  16.   // - Message that motivates to do measurement
  17.   //      (like good morning, or time to measurement)
  18.  
  19.   "topMessage": {
  20.     "title": "Update Measurement",
  21.     "message": "Last updated 14 May, 2019",
  22.     "situation": "O",
  23.     "icon": "http://icons.iconarchive.com/icons/papirus-team/papirus-status/256/dialog-error-icon.png"
  24.   },
  25.  
  26.   // Last measurement submitted by current user
  27.   // NOT the same model as in response to `GET .../measurement/...`
  28.   // If there are no measurements, just leave this field as null
  29.   //
  30.   // "lastMeasurement": null,     // YES
  31.   // "lastMeasurement": {},       // NO
  32.  
  33.   "lastMeasurement": {
  34.     "id": 1,
  35.     "date": "2019-02-07T12:00:00",
  36.     "situation": "O",
  37.     "stressScore": 8,
  38.     "stressScoreLabel": "Veel stress"
  39.   },
  40.  
  41.   // Data to display on dashboard tiles
  42.   // Max `recoveryIndices` length - 15 (numbers)
  43.   // If there are no measurements for this situation,
  44.   // just leave `recoveryIndices` list empty (NOT null)
  45.   //
  46.   // "recoveryIndices": [],     // YES
  47.   // "recoveryIndices": null,   // NO
  48.  
  49.   "recentMeasurements": [
  50.     {
  51.       "situation": "O",
  52.       "recoveryIndices": [
  53.         56,
  54.         45,
  55.         78,
  56.         12
  57.       ]
  58.     },
  59.     {
  60.       "situation": "R",
  61.       "recoveryIndices": []
  62.     },
  63.     {
  64.       "situation": "E",
  65.       "recoveryIndices": [
  66.         34
  67.       ]
  68.     }
  69.   ]
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement