-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMiServiceSharp.Api.http
More file actions
204 lines (166 loc) · 3.51 KB
/
MiServiceSharp.Api.http
File metadata and controls
204 lines (166 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
@host=http://localhost:5184
@apiKey=change-this-api-key
@jwt=
### Health
GET {{host}}/api/v1/health
### Login micoapi
POST {{host}}/api/v1/auth/login
Content-Type: application/json
{
"username": "{{MI_USER}}",
"password": "{{MI_PASS}}",
"sid": "micoapi"
}
### Start login challenge flow (recommended for notificationUrl cases)
POST {{host}}/api/v1/auth/login/challenge/start
Content-Type: application/json
{
"username": "{{MI_USER}}",
"password": "{{MI_PASS}}",
"sid": "micoapi"
}
### Continue challenge flow after user completed SMS verification page
POST {{host}}/api/v1/auth/login/challenge/continue
Content-Type: application/json
{
"sessionId": "REPLACE_WITH_SESSION_ID"
}
### Poll challenge flow status
GET {{host}}/api/v1/auth/login/challenge/REPLACE_WITH_SESSION_ID
### Login xiaomiio
POST {{host}}/api/v1/auth/login
Content-Type: application/json
{
"username": "{{MI_USER}}",
"password": "{{MI_PASS}}",
"sid": "xiaomiio"
}
### Read token file
GET {{host}}/api/v1/auth/token
X-API-Key: {{apiKey}}
### Read token file by JWT
GET {{host}}/api/v1/auth/token
Authorization: Bearer {{jwt}}
### Issue JWT (also triggers cloud login)
POST {{host}}/api/v1/auth/jwt
Content-Type: application/json
{
"username": "{{MI_USER}}",
"password": "{{MI_PASS}}"
}
### Mina devices
GET {{host}}/api/v1/mina/devices
X-API-Key: {{apiKey}}
### Miio devices
GET {{host}}/api/v1/miio/devices
X-API-Key: {{apiKey}}
### Mina TTS
POST {{host}}/api/v1/mina/tts
Content-Type: application/json
X-API-Key: {{apiKey}}
{
"account": {},
"deviceId": "YOUR_DEVICE_ID",
"text": "你好,这是 API 测试"
}
### Mina play url
POST {{host}}/api/v1/mina/play-url
Content-Type: application/json
X-API-Key: {{apiKey}}
{
"account": {},
"deviceId": "YOUR_DEVICE_ID",
"url": "http://example.com/test.mp3",
"type": 2
}
### Miio home rpc
POST {{host}}/api/v1/miio/home-rpc
Content-Type: application/json
X-API-Key: {{apiKey}}
{
"account": {},
"did": "YOUR_DID",
"method": "get_prop",
"params": ["power"]
}
### Miio home get-props
POST {{host}}/api/v1/miio/home/get-props
Content-Type: application/json
X-API-Key: {{apiKey}}
{
"account": {},
"did": "YOUR_DID",
"props": ["power", "temperature"]
}
### Miio home set-prop
POST {{host}}/api/v1/miio/home/set-prop
Content-Type: application/json
X-API-Key: {{apiKey}}
{
"account": {},
"did": "YOUR_DID",
"prop": "power",
"value": "on"
}
### Miot get-props
POST {{host}}/api/v1/miio/miot/get-props
Content-Type: application/json
X-API-Key: {{apiKey}}
{
"account": {},
"did": "YOUR_DID",
"iids": [
{ "siid": 2, "piid": 1 },
{ "siid": 2, "piid": 2 }
]
}
### Miot set-prop
POST {{host}}/api/v1/miio/miot/set-prop
Content-Type: application/json
X-API-Key: {{apiKey}}
{
"account": {},
"did": "YOUR_DID",
"siid": 2,
"piid": 2,
"value": 1
}
### Miot action
POST {{host}}/api/v1/miio/miot/action
Content-Type: application/json
X-API-Key: {{apiKey}}
{
"account": {},
"did": "YOUR_DID",
"siid": 2,
"aiid": 1,
"args": []
}
### Miot spec (json)
POST {{host}}/api/v1/miio/miot-spec
Content-Type: application/json
X-API-Key: {{apiKey}}
{
"account": {},
"type": "zhimi.airp.va1",
"format": "json"
}
### Miot spec (python text)
POST {{host}}/api/v1/miio/miot-spec
Content-Type: application/json
X-API-Key: {{apiKey}}
{
"account": {},
"type": "zhimi.airp.va1",
"format": "python"
}
### Local miio command
POST {{host}}/api/v1/miio/local/command
Content-Type: application/json
X-API-Key: {{apiKey}}
{
"host": "192.168.1.120",
"tokenHex": "00112233445566778899AABBCCDDEEFF",
"method": "miIO.info",
"params": []
}