UNIT
A UNIT is an instance of a certain UNIT-CLASS and can be addressed via an URI/URL. Each UNIT-CLASS is identified by a class-specific name.
air- weather
cal - calendar
cct - contact
dev - device
fle - file
idy - identity
loc - location
lst - list
msg - message
pky - public key
pwd - password
ref - reference
sce- service
A UNIT-CLASS defines variables (variable name and value datatype) of the JSON API.
JSON values must be one of the following data types:
- string
- number
- array
- boolean
- null
- object (JSON object)
According to a naming convention, the prefix of a UNIT-CLASS variable name refers to the data type.
| UP-Datatype | Description | Prefix | Examples { JSON-Object } |
| BOOLEAN | true | false | b_ |
"_b_protected":true |
| STRING (length) |
any String (maximum length) |
"_subject"":"Test me" | |
| NUMBER | integer | float | n_ | "_n_views":12 "n_latitude":12.34562 |
| UNIT (64) |
Typically a UNIT is linked with other UNITs i.e. the value of a variable can be the URI of another UNIT. The class-specific name can be ommited in the URI |
<UNIT-CLASS>_ |
"_lst_follower":"alice@a-provider.com?q=friends" |
| DATETIME (25) |
RFC3339 YYYY-MM-DDTHH:mm:ss+hh:mm |
dt_ | "_dt_expire":"2019-03-28T16:30:10+02:00" |
| DATEDAY (10) |
|
dd_ | "dd_birthday":"2000-12-24" |
| DATELOCAL (18) |
YYYY-MM-DD HH:mm |
dl_ | "dl_sunrise":"2019-03-28 16:30" |
| COUNTRY (2) |
ISO 3166-1 alpha-2 | c_ | "c_citizenship":"US" "c_nationality":"DE" "c_country":"AT" |
| ENUM (length) |
e_ | "e_messenger":"WHATSAPP" | |
| ARRAY |
a_ |
"a_forecast"=[{,,,},{...}] |
Every UNIT-CLASS has general variables (naming convention prefix '_' ).
| Variable | Semantic |
|---|---|
| _subject(32) | any (short) textual description |
| _lst_href(64) | lst-UNIT (e_type = HREF) ie. any https-link |
| _lst_units | lst-UNIT (e_type = UNIT) A UNIT may refer to any other UNITs |
| _super | UP-URI of another UNIT that may set default values for any variable of that UNIT |
| _b_abstract | true: not returned if _dt_update=0 in query false: |
| _icon(1024) | Bitmap of an icon (png) |
| _lst_follower | lst-UNIT (e_type = EMAIL) If _b_private=true then _lst_follower contains the list of email-adresses of UNITED-PAGES users that have read-access on any variable of that UNIT If _b_private=false then _lst_follower has no meaning |
| _b_protected | true: _lst_follower determines authorization false: no authentication required for read access |
| _dt_create | created at |
| _dt_update | updated at |
| _dt_expire | expire at - the UNIT will be automatically deleted |
| _n_views | every GET request except from the owner increases the counter |
| _licence(64) | Info that has to be regarded for usage |