Application registration
27 | 28 |Before you can send any API calls to the bridge you’ll need to register a username. Your 29 | bridge will remember your username, and keeps track of when it was last used.
30 | 31 |Multiple applications can be registered with the same username, as long as their devicetype 32 | is different. It is currently unknown what effect this might have on the bridge.
33 | 34 |You can deregister a registered application through the configuration.
35 | 36 |-
37 |
- Registering an application 38 |
Registering an application
39 | 40 |The response contains the username assigned. In some cases it might not be the same username as the one that 41 | was sent to the bridge.
42 | 43 |POST /api
44 |
45 | Parameters
46 | 47 |-
48 |
- username 49 |
- numbers (0-9) and letters (a-z, A-Z), between 10 and 40 bytes in length (inclusive). 50 |
- devicetype 51 |
- accepts any string, between 1 and 40 bytes in length (inclusive), used to label the application with a name. 52 |
Input
53 | 54 |{
55 | "username": "burgestrand",
56 | "devicetype": "Ruhue API Client"
57 | }
58 |
59 | Response
60 | 61 |Success
62 | 63 |[
64 | {
65 | "success": {
66 | "username": "burgestrand"
67 | }
68 | }
69 | ]
70 |
71 | Username containing a space
72 | 73 |In this case, the response contains the username to be used for subsequent API calls, as well as an error.
74 | 75 |[
76 | {
77 | "error": {
78 | "type": 7,
79 | "address": "/username",
80 | "description": "invalid value, kim burgestrand, for parameter, username"
81 | }
82 | },
83 | {
84 | "success": {
85 | "username": "508ed817c37c378e20ab523f25c4b"
86 | }
87 | }
88 | ]
89 |
90 | Link button not pressed
91 | 92 |[
93 | {
94 | "error": {
95 | "type": 101,
96 | "address": "",
97 | "description": "link button not pressed"
98 | }
99 | }
100 | ]
101 |
102 | Invalid username and empty devicetype
103 | 104 |[
105 | {
106 | "error": {
107 | "type": 7,
108 | "address": "/username",
109 | "description": "invalid value, burges, for parameter, username"
110 | }
111 | },
112 | {
113 | "error": {
114 | "type": 2,
115 | "address": "/",
116 | "description": "body contains invalid json"
117 | }
118 | }
119 | ]
120 |