Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
linenumberstrue
{
  "firstName": "Richard",
  "lastName": "Quin",
  "mobileNumber": "+31612345678",
  "appLastOpenedDate": "2018-03-13",
  "nickname": "RQ",
  "yonaPassword": "AES:128:UIBPamj33m0jlzvW/v2o2g==",
  "creationTime": "2018-03-13T18:38:25.373+0000",
  "vpnProfile": {
    "vpnPassword": "Jtkv5GmE7J3tdNTlDNVGSqcGfIZBwEFB",
    "vpnLoginID": "73770a6f-a26f-4e31-87c9-323ad905a082$0",
    "_links": {
      "yona:ovpnProfile": {
        "href": "http://localhost:8082/vpn/profile.ovpn"
      }
    }
  },
  "sslRootCertCN": "smoothwall003.yona",
  "_links": {
    "self": {
      "href": "httphttps://localhost:8082app.prd.yona.nu/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21?requestingUserId=3cae5a18-3a7a-4edf-90a4-4a5250672c21&requestingDeviceId=0567b2e2-3712-4b28-97f1-d128c6125010"
    },
    "yona:userPhoto": {
      "href": "httphttps://localhost:8082app.prd.yona.nu/userPhotos/149652e1-754d-4b38-b4da-9c5532afc89f"
    },
    "edit": {
      "href": "httphttps://localhost:8082app.prd.yona.nu/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21?requestingDeviceId=0567b2e2-3712-4b28-97f1-d128c6125010"
    },
    "yona:messages": {
      "href": "httphttps://localhost:8082app.prd.yona.nu/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/messages/"
    },
    "yona:dailyActivityReports": {
      "href": "httphttps://localhost:8082app.prd.yona.nu/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/activity/days/"
    },
    "yona:weeklyActivityReports": {
      "href": "httphttps://localhost:8082app.prd.yona.nu/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/activity/weeks/"
    },
    "yona:dailyActivityReportsWithBuddies": {
      "href": "httphttps://localhost:8082app.prd.yona.nu/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/activity/withBuddies/days/?requestingDeviceId=0567b2e2-3712-4b28-97f1-d128c6125010"
    },
    "yona:newDeviceRequest": {
      "href": "httphttps://localhost:8082app.prd.yona.nu/newDeviceRequests/+31612345678"
    },
    "yona:requestPinReset": {
      "href": "httphttps://localhost:8082app.prd.yona.nu/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/pinResetRequest/request"
    },
    "yona:editUserPhoto": {
      "href": "httphttps://localhost:8082app.prd.yona.nu/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/photo"
    },
    "curies": [
      {
        "href": "http://dev.yona.nu/rels/{rel}",
        "name": "yona",
        "templated": true
      }
    ]
  },
  "_embedded": {
    "yona:devices": {
      "_embedded": {
        "yona:devices": [
          {
            "name": "My S8",
            "operatingSystem": "ANDROID",
            "appLastOpenedDate": "2018-03-13",
            "vpnProfile": {
              "vpnPassword": "Jtkv5GmE7J3tdNTlDNVGSqcGfIZBwEFB",
              "vpnLoginID": "73770a6f-a26f-4e31-87c9-323ad905a082$0",
              "_links": {
                "yona:ovpnProfile": {
                  "href": "httphttps://localhost:8082app.prd.yona.nu/vpn/profile.ovpn"
                }
              }
            },
            "sslRootCertCN": "smoothwall003.yona",
            "vpnConnected": true,
            "registrationTime": "2018-03-13T18:38:25.470+0000",
            "requestingDevice": true,
            "_links": {
              "self": {
                "href": "httphttps://localhost:8082app.prd.yona.nu/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/devices/0567b2e2-3712-4b28-97f1-d128c6125010?requestingDeviceId=0567b2e2-3712-4b28-97f1-d128c6125010"
              },
              "edit": {
                "href": "httphttps://localhost:8082app.prd.yona.nu/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/devices/0567b2e2-3712-4b28-97f1-d128c6125010?requestingDeviceId=0567b2e2-3712-4b28-97f1-d128c6125010"
              },
              "yona:postOpenAppEvent": {
                "href": "httphttps://localhost:8082app.prd.yona.nu/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/devices/0567b2e2-3712-4b28-97f1-d128c6125010/openApp"
              },
              "yona:appActivity": {
                "href": "httphttps://localhost:8082app.prd.yona.nu/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/devices/0567b2e2-3712-4b28-97f1-d128c6125010/appActivity/"
              },
              "yona:sslRootCert": {
                "href": "httphttps://localhost:8082app.prd.yona.nu/ssl/rootcert.cer"
              },
              "yona:appleMobileConfig": {
                "href": "httphttps://localhost:8082app.prd.yona.nu/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/devices/0567b2e2-3712-4b28-97f1-d128c6125010/apple.mobileconfig"
              }
            },
            "sslRootCertCN": "smoothwall003.yona"
          }
        ]
      },
      "_links": {
        "self": {
          "href": "httphttps://localhost:8082app.prd.yona.nu/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/devices/?requestingDeviceId=0567b2e2-3712-4b28-97f1-d128c6125010"
        }
      }
    },
    "yona:goals": {
      "_embedded": {
        "yona:goals": [
          {
            "creationTime": "2017-01-01T12:00:00.000+0000",
            "maxDurationMinutes": 0,
            "historyItem": false,
            "_links": {
              "self": {
                "href": "httphttps://localhost:8082app.prd.yona.nu/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/goals/e6395085-d427-449b-a162-412c3788254d"
              },
              "yona:activityCategory": {
                "href": "httphttps://localhost:8082app.prd.yona.nu/activityCategories/192d69f4-8d3e-499b-983c-36ca97340ba9"
              }
            },
            "@type": "BudgetGoal"
          }
        ]
      },
      "_links": {
        "self": {
          "href": "httphttps://localhost:8082app.prd.yona.nu/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/goals/"
        }
      }
    },
    "yona:buddies": {
      "_embedded": {
        "yona:buddies": [
          {
            "nickname": "BD",
            "sendingStatus": "ACCEPTED",
            "receivingStatus": "ACCEPTED",
            "lastStatusChangeTime": "2018-03-13T18:46:22.410+0000",
            "_links": {
              "self": {
                "href": "httphttps://localhost:8082app.prd.yona.nu/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/buddies/7e987807-d6df-4d1b-a129-09e789e51eb6"
              },
              "edit": {
                "href": "httphttps://localhost:8082app.prd.yona.nu/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/buddies/7e987807-d6df-4d1b-a129-09e789e51eb6"
              },
              "yona:dailyActivityReports": {
                "href": "httphttps://localhost:8082app.prd.yona.nu/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/buddies/7e987807-d6df-4d1b-a129-09e789e51eb6/activity/days/"
              },
              "yona:weeklyActivityReports": {
                "href": "httphttps://localhost:8082app.prd.yona.nu/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/buddies/7e987807-d6df-4d1b-a129-09e789e51eb6/activity/weeks/"
              }
            },
            "_embedded": {
              "yona:user": {
                "firstName": "Bob",
                "lastName": "Dunn",
                "mobileNumber": "+31612345679",
                "appLastOpenedDate": "2018-03-13",
                "nickname": "BD",
                "creationTime": "2018-03-13T18:40:05.380+0000",
                "_links": {
                  "self": {
                    "href": "httphttps://localhost:8082app.prd.yona.nu/users/ba12b1b0-9f2d-4650-a0f7-63ee441653c6?requestingUserId=3cae5a18-3a7a-4edf-90a4-4a5250672c21"
                  }
                },
                "_embedded": {
                  "yona:devices": {
                    "_embedded": {
                      "yona:devices": [
                        {
                          "name": "My iPhone",
                          "vpnConnected": true,
                          "requestingDevice": false,
                          "_links": {
                            "self": {
                              "href": "httphttps://localhost:8082app.prd.yona.nu/users/ba12b1b0-9f2d-4650-a0f7-63ee441653c6/devices/ccdc588d-7c94-4cf3-8c60-de3fab8571bd{?requestingDeviceId}",
                              "templated": true
                            },
                            "edit": {
                              "href": "httphttps://localhost:8082app.prd.yona.nu/users/ba12b1b0-9f2d-4650-a0f7-63ee441653c6/devices/ccdc588d-7c94-4cf3-8c60-de3fab8571bd{?requestingDeviceId}",
                              "templated": true
                            }
                          }
                        }
                      ]
                    },
                    "_links": {
                      "self": {
                        "href": "httphttps://localhost:8082app.prd.yona.nu/users/ba12b1b0-9f2d-4650-a0f7-63ee441653c6/devices/{?requestingDeviceId}",
                        "templated": true
                      }
                    }
                  },
                  "yona:goals": {
                    "_embedded": {
                      "yona:goals": [
                        {
                          "creationTime": "2017-01-01T12:00:00.000+0000",
                          "maxDurationMinutes": 0,
                          "historyItem": false,
                          "_links": {
                            "self": {
                              "href": "httphttps://localhost:8082app.prd.yona.nu/users/ba12b1b0-9f2d-4650-a0f7-63ee441653c6/goals/144785f0-13e2-44fd-abde-246cc236aa76"
                            },
                            "yona:activityCategory": {
                              "href": "httphttps://localhost:8082app.prd.yona.nu/activityCategories/192d69f4-8d3e-499b-983c-36ca97340ba9"
                            }
                          },
                          "@type": "BudgetGoal"
                        }
                      ]
                    },
                    "_links": {
                      "self": {
                        "href": "httphttps://localhost:8082app.prd.yona.nu/users/ba12b1b0-9f2d-4650-a0f7-63ee441653c6/goals/"
                      }
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "_links": {
        "self": {
          "href": "httphttps://localhost:8082app.prd.yona.nu/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/buddies/"
        }
      }
    }
  }
}

This response contains everything the app needs to remember for offline access.

LinesDescription
2 - 189The regular properties of the user
49 - 224

Embedded resources

LinesDescription
50 - 98

Embedded resources

108 - 132
LinesDescription
59 - 107

Embedded devices of this user

Embedded devices of this user

LinesDescription
53 - 90

The user's device named "My S8"

LinesDescription
54 - 69The regular properties of this device, including a nested structure for the VPN profile
58 - 233
72The URL of this device. It can be used to retrieve it again and as identification.
75The edit URL, through which this device can be renamed or deleted
77 - 88Other links specific to this device


95The URL of the devices collection of this user.


99 - 123

Embedded goals of this user

LinesDescription
45 102 - 67115

The Gambling goal

LinesDescription
49103 - 105The regular properties of this goal
51 - 53108The URL of this goal. It can be used to retrieve it again and as identification.
58114The type discriminator of this goal, see Polymorphism below


63 - 65120The URL of the goals collection of this user. New goals can be created by POSTing them to this URL.


133 124 - 232223

Embedded buddies of this user

LinesDescription
71 127 - 118215

The buddy Bob

The data of the buddy and the related user, with all links are included, in accordance with the pattern described above for the device and goal.



11 - 4348

Links to related resources or actions

LinesDescription
12 - 14The URL of this user. This URL needs to be stored in the app, as it provides the access to the user information
15 - 17The user photo URL. A GET on this will return a PNG image
18The edit and delete URL of this user. To update, do a PUT on this URL, or remove it through DELETE
18 - 2021The URL of the messages of this user. A GET on this URL fetches a pageable set of the messages
21 - 2324The URL with the daily activity reports of this user. A GET on this URL fetches a pageable set of the activity reports
24 - 2627The URL with the weekly activity reports of this user. A GET on this URL fetches a pageable set of the activity reports27 - 29
30The URL with the daily activity reports of this user and their buddies. A GET on this URL fetches a pageable set of the activity reports
33This URL must be used to POST a new device request.
30 - 32The app must POST app activity (e.g. Facebook opened from then to then) to this URL
33 - 36If the user wants to reset their pin, the app must POST a pin reset request to this URL
39An updated user photo would need to be posted to this URL


The response contains a considerable set of URLs. The self-links are always there, but the other links are there if they are usable in the current state of the resource. E.g. before the mobile number of the user is confirmed, there won't be any links except for the the mobile number confirmation URL.

...