6 Devices are used throughout the API to identify a device / a client
7 application. A device ID can be any string matching the regular expression
8 ``[\w.-]+``. The client application MUST generate a string to be used as its
9 device ID, and SHOULD ensure that it is unique within the user account. A good
10 approach is to combine the application name and the name of the host it is
13 The API maintains subscriptions per device ID. Two distinct devices using the
14 same ID might receive (from their point of view) incomplete information. While
15 it is possible to retrieve a list of devices and their IDs from the server,
16 this SHOULD NOT be used to let a user select an existing device ID.
18 Each device has exactly one type, which can be either *desktop*, *laptop*,
19 *mobile*, *server* or *other*. When retrieving device information, clients
20 SHOULD map unknown device types to *other*. Clients MUST NOT send
21 different device types that those previously stated.
27 The Devices API defines the following resources ::
29 /user/{username}/devices
30 /user/{username}/device/{device_id}
36 Retrieve the list of existing devices ::
38 GET /user/{username}/devices
39 Content-Type: application/json
45 "username": "username",
49 "caption": "gPodder on my Notebook",
57 Get Device Information
58 ----------------------
60 Retrieve information about a specific device ::
62 GET /user/{username}/device/{device_id}
63 Content-Type: application/json
70 "caption": "gPodder on my Notebook",
75 404 is returned if no such device exists.
78 Update Device Information
79 -------------------------
81 Update the information of a device ::
83 POST /user/{username}/device/{device_id}
84 Content-Type: application/json
86 TODO response: return device information
88 The body of the request MUST contain a JSON object that can contain the fields
89 *caption* and *type*. The information stored on the server will be updated with
90 the provided values. Fields not included in the request will not be updated.
92 If no device with the specified Id exists, a new device is created. Default
93 values are used for missing fields.