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": "4ef09af073770a6f-522ea26f-4cdd4e31-adf287c9-ae3509397558323ad905a082$0",
    "vpnPassword_links": "FwW9LMFl2QHh3eZbBm6PfsZfZ7Va556l"{
      "yona:ovpnProfile": {
        "href": "http://localhost:8082/vpn/profile.ovpn"
      }
    }
  },
  "sslRootCertCN": "smoothwall003.yona",
  "openVPNProfile_links": "client\r\\ndev tun\r\\nresolv-retry infinite\r\\nnobind\r\\npersist-key\r\\npersist-tun\r\\n<ca>\r\\n-----BEGIN CERTIFICATE-----\r\\nMIICdDCCAd2gAwIBAgIJAKHlBds0knLfMA0GCSqGSIb3DQEBCwUAMDExEzARBgNV\r\\nBAMTCnlvbmEtZ3cwMDMxDTALBgNVBAoTBFlvbmExCzAJBgNVBAYTAk5MMB4XDTE1\r\\nMTAyNDE4NDAxNVoXDTIzMTAyMjE4NDAxNVowMTETMBEGA1UEAxMKeW9uYS1ndzAw\r\\nMzENMAsGA1UEChMEWW9uYTELMAkGA1UEBhMCTkwwgZ8wDQYJKoZIhvcNAQEBBQAD\r\\ngY0AMIGJAoGBAM9iCyAcl67qerg9IYbkFUDTxG73hhUTqglDA7GkDv0Q8AUK6sFN\r\\ngKgIKyQ4Qy4QuqVeunTwHP1LVlNk1rIu9QNKAxL90B8u5n7UO7B6ASkTokOd1aD0\r\\njxN9FVJZPcejyqnr12R+uzBW3N1ZK87J/hS5aaKhDu535QN0yEZRO0LtAgMBAAGj\r\\ngZMwgZAwHQYDVR0OBBYEFD7+oDI0SxNHItX1CBsh79qZ7nLSMGEGA1UdIwRaMFiA\r\\nFD7+oDI0SxNHItX1CBsh79qZ7nLSoTWkMzAxMRMwEQYDVQQDEwp5b25hLWd3MDAz\r\\nMQ0wCwYDVQQKEwRZb25hMQswCQYDVQQGEwJOTIIJAKHlBds0knLfMAwGA1UdEwQF\r\\nMAMBAf8wDQYJKoZIhvcNAQELBQADgYEAx671Cv4urGpLGrH21bdGjR29qEUYGwU9\r\\n+qWWNiFHSiu+1928Ix1wun2NMKIDQWQ/zsCy/NtUhajK5lonvYVfsmcLCIqveAEV\r\\nk01xnwm210/pltMc43SOQDc8uc9wzMVo5az1+KRFqX6tNWX0YcKiMZJYIBLnW1LV\r\\nMQ9Zm4u00bA=\r\\n-----END CERTIFICATE-----\r\\n</ca>\r\\nauth-user-pass\r\\ncipher AES-256-CBC\r\\nauth SHA1\r\\ncomp-lzo\r\\nverb 3\r\\nnobind\r\\nremote 185.3.210.43 443\r\\nproto tcp-client\r\\ntls-remote \"/C=NL/O=Yona/CN=yona-gw003\"\r\\n<tls-auth>\r\\n-----BEGIN OpenVPN Static key V1-----\r\\n106a6773b0c019f61c954784ad67b852\r\\n74d82b712dd235e436950e17d019c2e8\r\\na4205bb809af417d85952bfc0c921cf5\r\\nec2547526584749ec079fe4e3ad5e0ec\r\\n9f20d0b6a25c6535c21101f98c3af8e3\r\\n44ad0e18bd04e96f2e4992fa1cbf7b23\r\\n2255c535385a194a176003aad54c38c8\r\\n62a3c98ede521f2a71e1fc8b348eb344\r\\n3bdfad46bfb885d3888e39a3b4187cf5\r\\ne6e6ef631f0b0ab3eb8210df58eeb379\r\\n1b51a2886ea5dcdfa18d19100142516d\r\\na2a714cbca00d031371b6f972fc85e22\r\\n5dd16fb22bbfb2841b9f8dd01a991069\r\\ndddc18040c43776680f36a451a9c8e77\r\\n63e1f19b2cf2f13bc3443ec54299f179\r\\n0e653b2b4baa3765cbd533e906762224\r\\n-----END OpenVPN Static key V1-----\r\\n</tls-auth>\r\\nkey-direction 1\r\\n"
  },
  "_links": {
    "self{
    "self": {
      "href": "http://localhost:8082/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21?requestingUserId=3cae5a18-3a7a-4edf-90a4-4a5250672c21&requestingDeviceId=0567b2e2-3712-4b28-97f1-d128c6125010"
    },
    "yona:userPhoto": {
      "href": "http://localhost:8082/userPhotos/149652e1-754d-4b38-b4da-9c5532afc89f"
    },
    "edit": {
      "href": "http://localhost:8082/users/9288a7d23cae5a18-127d3a7a-43124edf-889090a4-0e29ddc7d93b4a5250672c21?includePrivateData=truerequestingDeviceId=0567b2e2-3712-4b28-97f1-d128c6125010"
    },
    "edityona:messages": {
      "href": "http://localhost:8082/users/9288a7d23cae5a18-127d3a7a-43124edf-8890-0e29ddc7d93b90a4-4a5250672c21/messages/"
    },
    "yona:messagesdailyActivityReports": {
      "href": "http://localhost:8082/users/9288a7d23cae5a18-127d3a7a-43124edf-889090a4-0e29ddc7d93b4a5250672c21/messagesactivity/days/"
    },
    "yona:dailyActivityReportsweeklyActivityReports": {
      "href": "http://localhost:8082/users/9288a7d23cae5a18-127d3a7a-43124edf-889090a4-0e29ddc7d93b4a5250672c21/activity/daysweeks/"
    },
    "yona:weeklyActivityReportsdailyActivityReportsWithBuddies": {
      "href": "http://localhost:8082/users/9288a7d23cae5a18-127d3a7a-43124edf-889090a4-0e29ddc7d93b4a5250672c21/activity/weeks/withBuddies/days/?requestingDeviceId=0567b2e2-3712-4b28-97f1-d128c6125010"
    },
    "yona:newDeviceRequest": {
      "href": "http://localhost:8082/newDeviceRequests/+31612345678"
    },
    "yona:appActivityrequestPinReset": {
      "href": "http://localhost:8082/users/9288a7d23cae5a18-127d3a7a-43124edf-889090a4-0e29ddc7d93b4a5250672c21/appActivitypinResetRequest/request"
    },
    "yona:requestPinReseteditUserPhoto": {
      "href": "http://localhost:8082/users/9288a7d23cae5a18-127d3a7a-43124edf-889090a4-0e29ddc7d93b4a5250672c21/pinResetRequest/requestphoto"
    },
    "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": "http://localhost:8082/vpn/profile.ovpn"
                }
              }
            },
            "vpnConnected": true,
            "registrationTime": "2018-03-13T18:38:25.470+0000",
            "requestingDevice": true,
            "_links": {
              "self": {
                "href": "http://localhost:8082/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/devices/0567b2e2-3712-4b28-97f1-d128c6125010?requestingDeviceId=0567b2e2-3712-4b28-97f1-d128c6125010"
              },
              "edit": {
                "href": "http://localhost:8082/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/devices/0567b2e2-3712-4b28-97f1-d128c6125010?requestingDeviceId=0567b2e2-3712-4b28-97f1-d128c6125010"
              },
              "yona:postOpenAppEvent": {
                "href": "http://localhost:8082/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/devices/0567b2e2-3712-4b28-97f1-d128c6125010/openApp"
              },
              "yona:appActivity": {
                "href": "http://localhost:8082/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/devices/0567b2e2-3712-4b28-97f1-d128c6125010/appActivity/"
              },
              "yona:sslRootCert": {
                "href": "http://localhost:8082/ssl/rootcert.cer"
              },
              "yona:appleMobileConfig": {
                "href": "http://localhost:8082/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/devices/0567b2e2-3712-4b28-97f1-d128c6125010/apple.mobileconfig"
              }
            },
            "sslRootCertCN": "smoothwall003.yona"
          }
        ]
      },
      "_links": {
        "self": {
          "href": "http://localhost:8082/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": "http://localhost:8082/users/9288a7d23cae5a18-127d3a7a-43124edf-889090a4-0e29ddc7d93b4a5250672c21/goals/1271ed5ae6395085-71f1d427-4ec2449b-9e58a162-3fb3da81c094412c3788254d"
              },
              "yona:activityCategory": {
                "href": "http://localhost:8082/activityCategories/192d69f4-8d3e-499b-983c-36ca97340ba9"
              }
            },
            "@type": "BudgetGoal"
          }
        ]
      },
      "_links": {
        "self": {
          "href": "http://localhost:8082/users/9288a7d23cae5a18-127d3a7a-43124edf-889090a4-0e29ddc7d93b4a5250672c21/goals/"
        }
      }
    },
    "yona:buddies": {
      "_embedded": {
        "yona:buddies": [
          {
            "nickname": "BD",
            "sendingStatus": "ACCEPTED",
            "receivingStatus": "ACCEPTED",
            "lastStatusChangeTime": "2018-03-13T18:46:22.410+0000",
            "_links": {
              "self": {
                "href": "http://localhost:8082/users/9288a7d23cae5a18-127d3a7a-43124edf-889090a4-0e29ddc7d93b4a5250672c21/buddies/0008fd8c7e987807-071fd6df-43fa4d1b-8262a129-e298ebaef07409e789e51eb6"
              },
              "edit": {
                "href": "http://localhost:8082/users/9288a7d23cae5a18-127d3a7a-43124edf-889090a4-0e29ddc7d93b4a5250672c21/buddies/0008fd8c7e987807-071fd6df-43fa4d1b-8262a129-e298ebaef07409e789e51eb6"
              },
              "yona:dailyActivityReports": {
                "href": "http://localhost:8082/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/buddies/7e987807-d6df-4d1b-a129-09e789e51eb6/activity/days/"
              },
              "yona:weeklyActivityReports": {
                "href": "http://localhost:8082/users/3cae5a18-3a7a-4edf-90a4-4a5250672c21/buddies/7e987807-d6df-4d1b-a129-09e789e51eb6/activity/weeks/"
              }
            },
            "_embedded": {
              "yona:goalsuser": {
                "firstName": "Bob",
                "lastName": "Dunn",
                "mobileNumber": "+31612345679",
                "appLastOpenedDate": "2018-03-13",
                "nickname": "BD",
                "creationTime": "2018-03-13T18:40:05.380+0000",
                "_links": {
                  "self": {
                    "href": "http://localhost:8082/users/ba12b1b0-9f2d-4650-a0f7-63ee441653c6?requestingUserId=3cae5a18-3a7a-4edf-90a4-4a5250672c21"
                  }
                },
                "_embedded": {
                  "yona:goalsdevices": {
                    "_embedded": {
                      "yona:devices": [
                        {
                          "maxDurationMinutesname": 0"My iPhone",
                          "vpnConnected": true,
                          "requestingDevice": false,
                          "_links": {
                            "self": {
                              "href": "http://localhost:8082/users/2cce3d82ba12b1b0-4a259f2d-434b4650-be8ba0f7-5eec53e6fc8863ee441653c6/goalsdevices/a0569de8ccdc588d-67a07c94-4a374cf3-8b27-ebdf158b3e86"8c60-de3fab8571bd{?requestingDeviceId}",
                              "templated": true
                            },
                        "yona:activityCategory    "edit": {
                              "href": "http://localhost:8082/activityCategoriesusers/192d69f4ba12b1b0-8d3e9f2d-499b4650-983c-36ca97340ba9"a0f7-63ee441653c6/devices/ccdc588d-7c94-4cf3-8c60-de3fab8571bd{?requestingDeviceId}",
                        }      "templated": true
               },             }
                      "@type": "BudgetGoal"   }
                        }
                      ]
                    },
                    "_links": {
                      "self": {
                        "href": "http://localhost:8082/users/2cce3d82ba12b1b0-4a259f2d-434b4650-be8ba0f7-5eec53e6fc8863ee441653c6/goalsdevices/{?requestingDeviceId}",
                        "templated": true
                      }
                    }
                  },
                  "yona:usergoals": {
                "firstName    "_embedded": "Bob"{
                      "yona:goals": [
                        {
                          "creationTime": "2017-01-01T12:00:00.000+0000",
                "lastName": "Dunn"          "maxDurationMinutes": 0,
                          "historyItem": false,
                "mobileNumber": "+13456789"          "_links": {
                            "self": {
                              "href": "http://localhost:8082/users/ba12b1b0-9f2d-4650-a0f7-63ee441653c6/goals/144785f0-13e2-44fd-abde-246cc236aa76"
                            },
                            "yona:activityCategory": {
                              "href": "http://localhost:8082/activityCategories/192d69f4-8d3e-499b-983c-36ca97340ba9"
                            }
                          },
                          "@type": "BudgetGoal"
                        }
                      ]
                    },
                    "_links": {
                      "self": {
                        "href": "http://localhost:8082/users/2cce3d82ba12b1b0-4a259f2d-434b4650-be8b-5eec53e6fc88a0f7-63ee441653c6/goals/"
                      }
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "_links": {
        "self": {
          "href": "http://localhost:8082/users/9288a7d23cae5a18-127d3a7a-43124edf-889090a4-0e29ddc7d93b4a5250672c21/buddies/"
        }
      }
    }
  }
}

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

44 - 127
LinesDescription
2 - 918The regular properties of the user, including a nested structure for the VPN profile
58 - 233

Embedded resources

13 31
LinesDescription
59 - 107

Embedded devices of this user

108 - 132

Embedded goals of this user

LinesDescription
45 - 67

The Gambling goal

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


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


68 133 - 127232

Embedded buddies of this user

LinesDescription
71 - 118

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 goal.



11 - 43

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 edit and delete URL of this user. To update, do a PUT on this URL, or remove it through DELETE
18 - 20The URL of the messages of this user. A GET on this URL fetches a pageable set of the messages
21 - 23The URL with the daily activity reports of this user. A GET on this URL fetches a pageable set of the activity reports
24 - 26The URL with the weekly activity reports of this user. A GET on this URL fetches a pageable set of the activity reports
27 - 29This 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


...