You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api.md
+17-8Lines changed: 17 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,14 @@
2
2
3
3
This document contains the API design. It is aimed at developers and to support administrators in debugging issues.
4
4
5
-
## API Responses
5
+
## High level guarantees
6
+
7
+
- Any resource will be available at the endpoints `/{resource}` for the collection and `/{resource}/{id}` for a single resource.
8
+
- Filtering on collection endpoints is implemented with URL paramaters (“query strings“)
9
+
- Collections always support the HTTP methods `GET` (read resources) and `POST` (create new resource)
10
+
- Resources support the HTTP methods `GET` (read resource), `PATCH` (update resource) and `DELETE` (delete resource)
11
+
12
+
## API responses
6
13
7
14
All API responses either have an emty body (for HTTP 204 and HTTP 404 responses) or the body consists of only JSON.
8
15
@@ -12,13 +19,15 @@ The `error` key always has a value of type `string`, containing a human readable
12
19
13
20
The `data` key is either a list of objects (for collection endpoints) or a single object (for resource endpoints).
14
21
15
-
Unset attributes are not contained in the objects that the API returns. Unless an attribute is defined in here to be always contained in API responses, it is optional
22
+
Unset attributes are not contained in the objects that the API returns. Unless an attribute is defined in here to be always contained in API responses with tse string `Always present`, it is optional.
16
23
17
-
### Reserved keys
24
+
##API resources
18
25
19
-
The objects in the `data` key have several reserved keys that are read-only:
26
+
API resources share the following **read only** attributes in the `data` key:
20
27
21
-
-`createdAt`: An RFC3339 timestamp of the time when the resource was created. Always present.
22
-
-`updatedAt`: An RFC3339 timestamp of the time when the resource was updated. Always present.
23
-
-`deletedAt`: An RFC3339 timestamp of the time when the resource was deleted.
24
-
-`id`: The ID of the object. IDs are unique for the backend instance. Always present.
28
+
-`createdAt` (string): An RFC3339 timestamp of the time when the resource was created. Always present.
29
+
-`updatedAt` (string): An RFC3339 timestamp of the time when the resource was updated. Always present.
30
+
-`deletedAt` (string): An RFC3339 timestamp of the time when the resource was deleted.
31
+
-`id` (number): The ID of the object. IDs are unique for the backend instance. Always present.
32
+
-`links` (object): A map of related resources. Always present.
33
+
-`self` (string): The full URL of the resource itself. Always present.
0 commit comments