Methods

The UP-API specifies the usage of the HTTP-methods GET, HEAD, PUT, POST and DELETE as described in RFC-2616. A request may contain a HTTP-body and HTTP-Basic-Authentication-Header. A response contains a HTTP-status and may contain an HTTP-response.  The UP-API specifies JSON as format for HTTP-body resp. HTTP-response.

  • GET - fetch data
    no HTTP-body, but all request-data is included in the URL and HTTP-header
  • HEAD - check existence of a resource
    similar to GET, but no HTTP-response, only HTTP-status
  • POST - create a new entity as a new subordinate
    not idempotent, i.e. if you retry the request N times, you will end up having N different subordinate-URIs (eg. a new message within an article)
  • PUT - update an already existing resource or create a new resource
    idempotent, i.e. if you retry the same request multiple times, the result is equivalent to single request
  • DELETE - delete an already existing resource

PUT, POST and DELETE always need authentication (using HTTP-Header, see DataPrivacy) whereas it is optional for GET and HEAD. The response of an authenticated GET may contain additionally protected variable/values for authorized users.

The Internet Assigned Numbers Authority (IANA) maintains the official registry of HTTP status codes.

UNITED-PAGES specifies the HTTP status code depending on the following conditions:

+ auth Basic-HTTP-Authentication successful
- auth Basic-HTTP-Authentication failed
+ anonymous Basic-HTTP-Authentication not used
+ unit URL correct,  UNIT existing
- unit URL correct,  UNIT not existing
- url URL-format wrong
+ read Authentication-username/email member of read-whitlist or write-whitelist or owner of UNIT
- read Authentication-username/email neither member of read-whitlist nor write-whitelist nor owner of UNIT
+ write Authentication-username/email member of write-whitelist or owner of UNIT
- write Authentication-username/email neither member of write-whitelist nor owner of UNIT

UNITED-PAGES specifies for each method the following HTTP status codes:

Status Code GET/HEAD PUT POST DELETE
OK
200
+ auth
+ unit
+ read
+ auth
+ unit
+ write
  + auth
+ owner
+ unit
201
Created
  + auth
+ owner
- unit
+ auth
+ owner
+ unit
 
206
Partial Content
+ anonymous
+ unit


OR

+ auth
+ unit
- read
     
400
Bad Request
- url - url - url - url
401
Unauthorized
- auth + anonymous

OR

- auth
+ anonymous

OR

- auth
+ anonymous

OR

- auth
403
Forbidden
  - unit
- owner

OR

+ unit
- write
- owner - owner
404
Not found
- unit     - unit
405
Method not
allowed
    (only allowed for
tok- and pin-UNIT)
 
409
Conflict
  already existing
(if _crud=create)