-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathopenapi.yaml
203 lines (203 loc) · 6.77 KB
/
openapi.yaml
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
openapi: 3.0.0
info:
version: 0.1.0
title: NanoMDM API
paths:
/v1/pushcert:
put:
description: Upload APNs certificate and private key.
security:
- basicAuth: []
requestBody:
description: The request body includes the APNs certificate and private key in PEM-encoded format concatenated together *without* any wrapping or container formats like JSON. The private key must *not* be encrypted.
required: true
content:
text/plain:
schema:
type: string
example: |-
-----BEGIN CERTIFICATE-----
MIIFdjCCBF6gAwIBAgIIZ7SjAeWsGIwwDQYJKoZIhvcNAQELBQAwgYwxQDA+BgNV
[..snip..]
lL5jy74l8Za59w==
-----END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAyfyVbzvN3t0RZgemV2YNGByPjIC3nAyMeabAg/xh/RlqS1uY
[..snip..]
ThmdpyJ76efnVCpgta/av0LZ6S9914MJpw2ff6H2Ou3y54Jy/94=
-----END RSA PRIVATE KEY-----
responses:
'200':
description: The "topic" (UID attribute) from the uploaded APNs certificate is returned or any errors that occured with the upload and storage.
content:
application/json:
schema:
type: object
properties:
error:
type: string
topic:
type: string
description: The "topic" (UID attribute) from the uploaded APNs certificate.
example: 'com.apple.mgmt.External.e3b8ceac-1f18-2c8e-8a63-dd17d99435d9'
'401':
$ref: '#/components/responses/UnauthorizedError'
'500':
description: Error reading HTTP body from request
/v1/push/{id*}:
get:
description: Send APNs push notifications to MDM enrollments
security:
- basicAuth: []
responses:
'200':
$ref: '#/components/responses/APIResultOK'
'207':
$ref: '#/components/responses/APIResultSomeFailed'
'500':
$ref: '#/components/responses/APIResultAllFailed'
'401':
$ref: '#/components/responses/UnauthorizedError'
parameters:
- $ref: '#/components/parameters/idParam'
/v1/enqueue/{id*}:
put:
description: Enqueue MDM commands to MDM enrollments and (optionally) send APNs push notifications
security:
- basicAuth: []
requestBody:
description: The request body is an XML-encoded MDM command plist.
required: true
content:
text/plain:
# Apple plists can't cleanly be represented in OpenAPI specification so we have to fake the Content-Type as text/plain.
schema:
type: string
example: |-
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Command</key>
<dict>
<key>RequestType</key>
<string>ProfileList</string>
</dict>
<key>CommandUUID</key>
<string>fedd659e-fc3c-4e35-8bb1-c8f51ae542a5</string>
</dict>
</plist>
responses:
'200':
$ref: '#/components/responses/APIResultOK'
'207':
$ref: '#/components/responses/APIResultSomeFailed'
'400':
description: Error decoding MDM command plist.
'401':
$ref: '#/components/responses/UnauthorizedError'
'500':
description: One of two modes. One mode is an error reading HTTP body from request (which will return no content nor content-type). Otherwise all enqueue requests failed. Returns JSON API response object including errors.
content:
application/json:
schema:
$ref: '#/components/schemas/APIResult'
parameters:
- $ref: '#/components/parameters/idParam'
- in: query
name: nopush
schema:
type: string
example: '1'
/version:
get:
description: Returns the running NanoMDM version
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
version:
type: string
example:
version: "v0.1.0"
components:
parameters:
idParam:
name: id*
in: path
description: Enrollment ID(s) of device- or user-channel enrollments. Typically a UUID-looking identifier.
required: true
explode: true
style: simple
schema:
type: array
items:
type: string
minItems: 1
example: ['299BD49-1A0C-422C-B285-2E4FF087C673', 'E2E4A8EB-45EE-488D-B9D7-4CC3B1C40699']
securitySchemes:
basicAuth:
type: http
scheme: basic
responses:
UnauthorizedError:
description: API key is missing or invalid.
headers:
WWW-Authenticate:
schema:
type: string
APIResultOK:
description: All requests succeeded. Returns JSON API response object.
content:
application/json:
schema:
$ref: '#/components/schemas/APIResult'
APIResultSomeFailed:
description: Some requests succeeded and some failed. Returns JSON API response object including errors.
content:
application/json:
schema:
$ref: '#/components/schemas/APIResult'
APIResultAllFailed:
description: All requests failed. Returns JSON API response object including errors.
content:
application/json:
schema:
$ref: '#/components/schemas/APIResult'
schemas:
APIResult:
type: object
description: foo
properties:
no_push:
type: boolean
default: false
push_error:
type: string
command_error:
type: string
command_uuid:
type: string
example: 'c7fc0872-f22f-4823-8ae0-f3d0174fb48a'
format: uuid
request_type:
type: string
status:
type: object
properties:
$id:
type: object
properties:
push_error:
type: string
push_result:
type: string
format: uuid
example: '6E14E52F-7F07-42C7-8367-4D81441DC85F'
description: Push UUID from Apple Push Notification service servers.
command_error:
type: string