Skip to content

Commit 61d5c3a

Browse files
committed
feat(docs): update api-reference
1 parent 3ba2340 commit 61d5c3a

22 files changed

Lines changed: 6800 additions & 0 deletions
Lines changed: 296 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,296 @@
1+
---
2+
title: discue scheduling and queueing API v0.1.0
3+
language_tabs:
4+
- shell: curl
5+
- javascript: JavaScript
6+
- python: Python
7+
- go: Go
8+
toc_footers: []
9+
includes: []
10+
search: true
11+
code_clipboard: true
12+
highlight_theme: darkula
13+
headingLevel: 3
14+
api:
15+
method: post
16+
path: /api_keys
17+
name: Create an api key
18+
19+
---
20+
21+
# Create an api key
22+
23+
<p class="text-lg">
24+
<span class="font-medium">POST</span> /api_keys
25+
</p>
26+
27+
*Create a new api key*
28+
29+
::: tip Authentication
30+
To perform this operation, you must provide a valid api key. See [Authentication](/getting-started/#prerequisites).
31+
:::
32+
33+
## Examples
34+
<CodeGroup><CodeGroupItem title="shell">
35+
36+
```shell
37+
curl -X POST http://api.discue.io/v1/api_keys \
38+
-H 'Accept: application/json' \
39+
-H 'X-API-KEY: API_KEY'
40+
```
41+
42+
</CodeGroupItem>
43+
44+
<CodeGroupItem title="javascript">
45+
46+
```javascript
47+
const headers = {
48+
'Accept':'application/json',
49+
'X-API-KEY':'API_KEY'
50+
}
51+
52+
const response = await fetch('http://api.discue.io/v1/api_keys', {
53+
method: 'POST', headers
54+
})
55+
56+
const body = await response.json()
57+
```
58+
59+
</CodeGroupItem>
60+
61+
<CodeGroupItem title="python">
62+
63+
```python
64+
import requests
65+
headers = {
66+
'Accept': 'application/json',
67+
'X-API-KEY': 'API_KEY'
68+
}
69+
70+
r = requests.post('http://api.discue.io/v1/api_keys', headers = headers)
71+
```
72+
73+
</CodeGroupItem>
74+
75+
<CodeGroupItem title="go">
76+
77+
```go
78+
package main
79+
80+
import (
81+
"bytes"
82+
"net/http"
83+
)
84+
85+
func main() {
86+
87+
headers := map[string][]string{
88+
"Accept": []string{"application/json"},
89+
"X-API-KEY": []string{"API_KEY"},
90+
}
91+
92+
data := bytes.NewBuffer([]byte{jsonReq})
93+
req, err := http.NewRequest("POST", "http://api.discue.io/v1/api_keys", data)
94+
req.Header = headers
95+
96+
client := &http.Client{}
97+
resp, err := client.Do(req)
98+
}
99+
```
100+
101+
</CodeGroupItem>
102+
103+
</CodeGroup>
104+
105+
## Parameters
106+
|Name|In|Type|Required|Description|
107+
|---|---|---|---|---|
108+
|pretty|query|boolean||Return the response pretty printed|
109+
110+
## Responses
111+
112+
::: tip 200 Response
113+
:::
114+
115+
```json
116+
{
117+
"api_key": "EPLPXwVOdhCxc4lylNpMeDM0_GhnCAZg3tFrWtZbb0cYQ7NCyRVfaN-O9rItf5kw",
118+
"_links": {
119+
"self": {
120+
"href": "https://api.discue.io/queues/180994c-b6b2-4d0e-b7ad-414716e83386/messages/8476f9ea-e457-4fed-8fbd-347a96237a96"
121+
}
122+
}
123+
}
124+
```
125+
126+
::: tip 400 Response
127+
:::
128+
129+
```json
130+
{
131+
"title": "Bad Request",
132+
"status": 400
133+
}
134+
```
135+
136+
::: tip 401 Response
137+
:::
138+
139+
```json
140+
{
141+
"title": "Unauthorized",
142+
"status": 401
143+
}
144+
```
145+
146+
::: tip 402 Response
147+
:::
148+
149+
```json
150+
{
151+
"title": "Payment Required",
152+
"status": 402
153+
}
154+
```
155+
156+
::: tip 403 Response
157+
:::
158+
159+
```json
160+
{
161+
"title": "Forbidden",
162+
"status": 403
163+
}
164+
```
165+
166+
::: tip 404 Response
167+
:::
168+
169+
```json
170+
{
171+
"title": "Not Found",
172+
"status": 404
173+
}
174+
```
175+
176+
::: tip 405 Response
177+
:::
178+
179+
```json
180+
{
181+
"title": "Method Not Allowed",
182+
"status": 405
183+
}
184+
```
185+
186+
::: tip 406 Response
187+
:::
188+
189+
```json
190+
{
191+
"title": "Not Acceptable",
192+
"status": 406
193+
}
194+
```
195+
196+
::: tip 409 Response
197+
:::
198+
199+
```json
200+
{
201+
"title": "Conflict",
202+
"status": 409
203+
}
204+
```
205+
206+
::: tip 415 Response
207+
:::
208+
209+
```json
210+
{
211+
"title": "Unsupported Media Type",
212+
"status": 415
213+
}
214+
```
215+
216+
::: tip 422 Response
217+
:::
218+
219+
```json
220+
{
221+
"title": "Unprocessable Entity",
222+
"status": 422
223+
}
224+
```
225+
226+
::: tip 423 Response
227+
:::
228+
229+
```json
230+
{
231+
"title": "Locked",
232+
"status": 423
233+
}
234+
```
235+
236+
::: tip 429 Response
237+
:::
238+
239+
```json
240+
{
241+
"title": "Too Many Requests",
242+
"status": 429
243+
}
244+
```
245+
246+
::: tip 500 Response
247+
:::
248+
249+
```json
250+
{
251+
"title": "Internal Server Error",
252+
"status": 500
253+
}
254+
```
255+
256+
::: tip 501 Response
257+
:::
258+
259+
```json
260+
{
261+
"title": "Not Implemented",
262+
"status": 501
263+
}
264+
```
265+
266+
::: tip 503 Response
267+
:::
268+
269+
```json
270+
{
271+
"title": "Service Unavailable",
272+
"status": 503
273+
}
274+
```
275+
276+
|Status|Meaning|Description|Schema|
277+
|---|---|---|---|
278+
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Ok|[PostApiKeyResponse](#postapikeyresponse)|
279+
|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad Request|Inline|
280+
|401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|Unauthorized|Inline|
281+
|402|[Payment Required](https://tools.ietf.org/html/rfc7231#section-6.5.2)|Payment Required|Inline|
282+
|403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|Forbidden|Inline|
283+
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not Found|Inline|
284+
|405|[Method Not Allowed](https://tools.ietf.org/html/rfc7231#section-6.5.5)|Method Not Allowed|Inline|
285+
|406|[Not Acceptable](https://tools.ietf.org/html/rfc7231#section-6.5.6)|Not Acceptable|Inline|
286+
|409|[Conflict](https://tools.ietf.org/html/rfc7231#section-6.5.8)|Conflict|Inline|
287+
|415|[Unsupported Media Type](https://tools.ietf.org/html/rfc7231#section-6.5.13)|Unsupported Media Type|Inline|
288+
|422|[Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3)|Unprocessable Entity|Inline|
289+
|423|[Locked](https://tools.ietf.org/html/rfc2518#section-10.4)|Locked|Inline|
290+
|429|[Too Many Requests](https://tools.ietf.org/html/rfc6585#section-4)|Too Many Requests|Inline|
291+
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|Inline|
292+
|501|[Not Implemented](https://tools.ietf.org/html/rfc7231#section-6.6.2)|Not Implemented|Inline|
293+
|503|[Service Unavailable](https://tools.ietf.org/html/rfc7231#section-6.6.4)|Service Unavailable|Inline|
294+
295+
---
296+

0 commit comments

Comments
 (0)