-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhm-device-management-v1.yml
271 lines (265 loc) · 7.87 KB
/
hm-device-management-v1.yml
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
swagger: '2.0'
info:
version: '1.0'
title: Device Management API
description: >-
The Device Management API allows you to create and revoke Device Certificates for your mobile clients that are using the iOS SDK or the Android SDK.
Sandbox server: `https://sandbox.api.high-mobility.com`
Production server: `https://api.high-mobility.com`
securityDefinitions:
ServiceAccountToken:
type: apiKey
name: Authorization
description: >-
This is a Bearer token. Service Account Token is a temporary token for
server to service communication, find out more how to generate one at
https://high-mobility.com/learn/documentation/cloud-api/service-account-api/intro/
in: header
paths:
/v1/device_certificates/{id}:
get:
security:
- ServiceAccountToken: []
tags:
- DeviceCertificate
summary: ''
responses:
'200':
schema:
$ref: '#/definitions/DeviceCertificate'
description: Success
'401':
schema:
$ref: '#/definitions/UnauthorizedErrors'
description: When an invalid ServiceAccountToken is used.
'404':
schema:
$ref: '#/definitions/Errors'
description: Not found
'500':
description: Server Errors
parameters:
- type: string
required: true
name: Authorization
in: header
description: A Service Account Token
- type: string
required: true
name: id
in: path
description: The id of the device certificate
operationId: ApiWeb.DeviceCertificateController.show
description: Retrieves a device certificate.
delete:
security:
- ServiceAccountToken: []
tags:
- DeviceCertificate
summary: ''
responses:
'204':
description: Success
'401':
schema:
$ref: '#/definitions/UnauthorizedErrors'
description: When an invalid ServiceAccountToken is used.
'404':
schema:
$ref: '#/definitions/Errors'
description: Not found
'500':
description: Server Errors
parameters:
- type: string
required: true
name: Authorization
in: header
description: A Service Account Token
- type: string
required: true
name: id
in: path
description: The id of the device certificate
operationId: ApiWeb.DeviceCertificateController.delete
description: Revokes a device certificate.
/v1/device_certificates:
post:
security:
- ServiceAccountToken: []
tags:
- DeviceCertificate
summary: ''
responses:
'201':
schema:
$ref: '#/definitions/DeviceCertificate'
description: Success
'401':
schema:
$ref: '#/definitions/UnauthorizedErrors'
description: When an invalid ServiceAccountToken is used.
'422':
schema:
$ref: '#/definitions/Errors'
description: Errors
'500':
description: Server Errors
parameters:
- type: string
required: true
name: Authorization
in: header
description: A Service Account Token
- in: body
name: body
required: true
schema:
$ref: '#/definitions/DeviceCertificateRequest'
operationId: ApiWeb.DeviceCertificateController.create
description: Creates a device certificate.
get:
security:
- ServiceAccountToken: []
tags:
- DeviceCertificate
summary: ''
responses:
'200':
schema:
$ref: '#/definitions/DeviceCertificates'
description: Success
'401':
schema:
$ref: '#/definitions/UnauthorizedErrors'
description: When an invalid ServiceAccountToken is used.
'500':
description: Server Errors
parameters:
- type: string
required: true
name: Authorization
in: header
description: A Service Account Token
operationId: ApiWeb.DeviceCertificateController.index
description: Lists all device certificates.
definitions:
Errors:
type: array
title: Errors
items:
$ref: '#/definitions/Error'
description: List of errors
Error:
type: object
title: Error
required:
- title
properties:
title:
type: string
description: Error title
source:
type: string
description: Field that has problem
detail:
type: string
description: Error detail
description: Error details
DeviceCertificateRequest:
type: object
properties:
public_key:
type: string
format: base64
description: >-
The public key of the device that was generated with HMKit. The size
should be 128 characters
app_id:
type: string
description: the serial number of the application associated with the certificate
device_name:
type: string
description: the display name of the device
sdk_info:
type: string
description: The type and version of the SDK
required:
- public_key
- app_id
DeviceCertificates:
type: array
title: Device Certificates
items:
$ref: '#/definitions/DeviceCertificate'
description: List of Device Certificates
DeviceCertificate:
type: object
title: Device Certificate
required:
- device_serial_number
- issuer_public_key
- issuer_name
- app_id
- signature
- public_key
- id
properties:
signature:
type: string
description: the cryptographic signature of the device certificate (base64)
public_key:
type: string
description: the public key of the device certificate (base64)
issuer_public_key:
type: string
description: >-
the public key of the Certificate Authority that has issued the
certificate
issuer_name:
type: string
description: >-
the name of the Certificate Authority that has issued the certificate,
which is always exve for published apps
id:
type: integer
description: the unique identifier of the device certificate
device_serial_number:
type: string
description: the serial number of the device
device_name:
type: string
description: the display name of the device
app_id:
type: string
description: the serial number of the application associated with the certificate
example:
signature: >-
Ol8VNEQbNvb2zdaMquq+ovOvVKF9gGt8goKUuuFB0gcN4awZLTnKDXV4NsnRFV8ASxp/gJJa5NfJeFJuqbcwkA==
public_key: >-
1zxuh/pcdaz59nblzsz5e2y3vc0dufnzidcqubdpihzsjjcfcbne/dkorz6kxkecchqzfhbr1ha+yk+7/tzzzw==
issuer_public_key: >-
wxj6v+kfyfncrnd4rzeody/gtytyoqgyizyksoh67buk7gohv67afe8kzpmfl/b1wjxnxqb9x4eeekwv/nfomg==
issuer_name: xvhm
id: c11f0e15-c078-4f5c-a077-c15675fec5aa
device_serial_number: f96705fcdca5d006ce
device_name: my device
app_id: a96027ee1779b53b1a9d6dfe
description: >-
The Device Certificate proves that the the app has been created by a
certified developer.
UnauthorizedErrors:
type: object
title: Errors
properties:
errors:
description: List of errors
type: array
items:
$ref: '#/definitions/Error'
example:
- detail: >
Missing or invalid authorization header. The token must be
obtained through the service account API and sent as a header with
the format "Authorization: Bearer <token>"
source: Authorization