-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver-openapi.yaml
More file actions
371 lines (362 loc) · 12.4 KB
/
Copy pathserver-openapi.yaml
File metadata and controls
371 lines (362 loc) · 12.4 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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
openapi: 3.0.4
info:
title: Freedeck Connect API
description: Remember, this API can change at any time! Remember to check the docs every once in a while if something stops working. **NOTE THAT ALL METHODS WITH AUTHORIZATION ARE ONLY IF THE SERVER HAS THE AUTHORIZATION/PASSWORD FEATURE ENABLED. IF NOT, YOU MAY IGNORE IT.** These docs will assume you have the authorization/password feature enabled.
version: 6.0.0
servers:
- url: http://localhost:5754/
components:
securitySchemes:
ApiKeyAuth:
description: Your Freedeck API token beginning with "fd."
type: apiKey
in: header
name: Authorization
schemas:
handoffState:
type: object
required:
- status
- message
properties:
message:
type: string
example: Successfully completed action.
status:
type: string
example: success
paths:
/api/auth:
post:
tags:
- Authentication
summary: Obtain an API token.
responses:
"200":
description: OK
content:
application/json:
schema:
type: object
properties:
token:
type: string
example: 'fd.a3dafc9d044e40fae380f9789567b'
given:
description: When the API token was issued (created hash) on the server.
type: number
example: 1754299957498
expiresAt:
description: When the API token will expire. Upon expiry, the token is granted 1 final use.
type: number
example: 1754299987502
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
id:
type: string
description: Identify the application through token.
example: myApp
password:
type: string
description: The Freedeck server's password
example: fd.093153af95a8ea96bd0526030a782691d3f001d2eb6996af86852bd202b73275654761ae8aac1c32d2e675c75088da8425f4bf4ac7061561af64e38314ff1f2e
preHashed:
description: State if your given password is already hashed (with the prefix "fd.")
type: boolean
example: true
/api/native/*:
get:
summary: Forward to Native App Handler
responses:
"200":
description: OK - Documentation for Freedeck App's native/websocket methods coming soon.
tags:
- FreedeckWS
/api/discover:
get:
summary: Identifies a running Freedeck Server.
tags:
- Discovery API
responses:
"200":
description: OK
content:
application/json:
schema:
type: object
properties:
title:
type: string
example: Freedeck
version:
type: string
example: 6.0.0-rc4
plugins:
type: array
description: A list of currently installed plugins.
items:
type: string
example:
- obscontrol
- v2.0.0
webpackStatus:
type: string
description: Can be any of 'uninitialized', 'compiling', or 'ready'. Used to halt immediate Companion connection to await bundles being fresh and ready.
example: compiling
deviceStatus:
description: Whether or not the user's external Freedeck Client is connected
type: boolean
ip:
description: The local IPs discovered on the machine.
type: string
myApp:
description: MyFreedeck properties
type: object
properties:
code:
type: string
description: The generated code to connect locally
example: ABCDEF
host:
type: string
description: The MyFreedeck server host.
example: https://my.freedeck.app/
/api/discover/code-request:
get:
tags:
- Discovery API
summary: Request a MyFreedeck code forcefully.
description: Not recommended, as it will send the IP and hostname without consent if not done by Companion. Will be removed in the full stable release of Freedeck v6.0.0.
deprecated: true
responses:
"200":
description: OK
content:
text/plain:
schema:
type: string
example: ABCDEF
/api/upload/report:
get:
tags:
- Uploads
summary: Give you a list of every uploaded sound, then file to the Freedeck Library.
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
type: array
items:
type: string
example: [["sound.mp3"],["icon.png"]]
/api/upload/sound:
post:
tags:
- Uploads
summary: "Upload a sound to the Freedeck Library. NOTE: All upload routes will eventually be covered in auth with a token."
responses:
"200":
description: OK
content:
application/json:
schema:
type: object
required:
- oldName
- newName
properties:
oldName:
type: string
description: Your uploaded filename
example: sound.mp3
newName:
type: string
description: What Freedeck MAY have renamed it to, so the Client can keep track.
example: sound.mp3
/api/upload/icon:
post:
tags:
- Uploads
summary: "Upload an icon to the Freedeck Library. NOTE: All upload routes will eventually be covered in auth with a token."
responses:
"200":
description: OK
content:
application/json:
schema:
type: object
required:
- oldName
- newName
properties:
oldName:
type: string
description: Your uploaded filename
example: templateStatic.png
newName:
type: string
description: What Freedeck MAY have renamed it to, so the Client can keep track.
example: templateStatic.png
/api/plugin/{pluginId}:
get:
tags:
- Discovery API
parameters:
- in: path
name: pluginId
schema:
type: string
example: obscontrol
required: true
description: ID of the plugin to get.
summary: Get information on a specific plugin.
responses:
"200":
description: OK
content:
application/json:
schema:
type: string
example: gui
examples:
auth:
summary: Authorized
value: {"instance":{"v2":true,"name":"OBS Control","author":"Freedeck","imports":[],"Settings":{"password":"-REDACTED-"},"hooks":[{"type":4,"name":"editor.view"},{"type":1,"name":"oc/server.js"},{"type":0,"name":"oc/server.js"}],"views":{"OBS Control":"editor.view"},"dashModules":{},"id":"obscontrol","stopped":false,"hasInit":true,"popout":"","_hookLocation":"user-data/hooks/","_usesAsar":false,"_id":"opi9xi","_callbacks":{"0":[null]},"_intent":[0,1],"io":{"active":false},"types":[{"type":"obs.cf","renderType":"button","templateData":{"password":"change-me"},"name":"Reconnect to OBS","pluginId":"obscontrol","hidden":true,"display":"OBS Control"}],"currentDataPacket":{},"version":"2.0.0","file":{"filePath":"obscontrol.fdpackage"}}}
err_login:
summary: "Error: Invalid Token"
value: {"error":true,"message":"Invalid token"}
err_no_token:
summary: "Error: No Token"
value: {"error":true,"message":"No token provided"}
security:
- ApiKeyAuth: []
/handoff/get-token:
get:
tags:
- Legacy Handoff V1 API
summary: Request a HandoffAPI Token. THIS IS DIFFERENT FROM THE AuthenticatedAPITokens AND WILL EVENTUALLY BE REPLACED, THIS IS KEPT AROUND FOR LEGACY SUPPORT
responses:
"200":
description: OK
content:
text/plain:
schema:
type: string
example: 3YJQ0BF65H3HAFJPT7GMPD
/handoff/{token}/play-ui-sound/{sound}:
get:
tags:
- Legacy Handoff V1 API
summary: Play a UI Sound through every client. Only maps to the current soundpack and it's available sounds.
parameters:
- in: path
name: token
schema:
type: string
example: 3YJQ0BF65H3HAFJPT7GMPD
required: true
description: The HandoffAPI Token.
- in: path
name: sound
schema:
type: string
example: mobile_connect
required: true
description: The key of the sound that maps to the sound file.
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/handoffState"
/handoff/{token}/reload-plugins:
get:
tags:
- Legacy Handoff V1 API
summary: Tells the server to internally reload the plugin cache, then reload the clients to get the updates.
parameters:
- in: path
name: token
schema:
type: string
example: 3YJQ0BF65H3HAFJPT7GMPD
required: true
description: The HandoffAPI Token.
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/handoffState"
/handoff/{token}/notify/{data}:
get:
tags:
- Legacy Handoff V1 API
summary: Send a server-wide broadcasted notification to all connected clients.
parameters:
- in: path
name: token
schema:
type: string
example: 3YJQ0BF65H3HAFJPT7GMPD
required: true
description: The HandoffAPI Token.
- in: path
name: data
schema:
type: string
example: I'm a notification!
required: true
description: The actual data to be shown to all clients.
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/handoffState"
/handoff/{token}/notify/{data}/{sender}:
get:
tags:
- Legacy Handoff V1 API
summary: Send a server-wide broadcasted notification to all connected clients, but replace the sender with your name instead of just Handoff.
parameters:
- in: path
name: token
schema:
type: string
example: 3YJQ0BF65H3HAFJPT7GMPD
required: true
description: The HandoffAPI Token.
- in: path
name: data
schema:
type: string
example: I'm a notification!
required: true
description: The actual data to be shown to all clients.
- in: path
name: sender
schema:
type: string
example: My App
required: true
description: The notification sender's name.
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/handoffState"