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 | not private or Authentication-username/email member of _lst_follower or owner of UNIT |
| - read | private and Authentication-username/email neither member of_lst_follower nor owner of UNIT |
| + owner | Authentication-username/email member owner of UNIT |
| - owner | No Authentication or Authentication-username/email not 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 |
+ unit + owner |
+ unit + owner |
|
| 201 Created |
- unit + owner |
- unit + owner |
||
| 206 Partial Content |
- read | |||
| 400 Bad Request |
- url | - url | - url | - url |
| 401 Unauthorized |
- auth | - owner | - owner | - owner |
| 404 Not found |
- unit | - unit | ||
| 405 Method not allowed |
(tok-UNIT only) | |||
| 409 Conflict |
already existing (if _crud=create) |