Skip to content

Commit 2255cee

Browse files
committed
feat: update from latest api spec
1 parent 8f33a31 commit 2255cee

4 files changed

Lines changed: 346 additions & 21 deletions

File tree

docs/api-reference/queues/create-a-queue.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,7 @@ func main() {
154154
{
155155
"queue": {
156156
"id": "string",
157-
"name": "string",
158-
"listeners": [
159-
{
160-
"id": "string",
161-
"name": "string"
162-
}
163-
]
157+
"name": "string"
164158
},
165159
"_links": {
166160
"self": {

docs/api-reference/queues/get-a-queue-by-id.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,7 @@ func main() {
125125
{
126126
"queue": {
127127
"id": "string",
128-
"name": "string",
129-
"listeners": [
130-
{
131-
"id": "string",
132-
"name": "string"
133-
}
134-
]
128+
"name": "string"
135129
},
136130
"_links": {
137131
"self": {

docs/api-reference/queues/update-a-queue-by-id.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,7 @@ func main() {
145145
{
146146
"queue": {
147147
"id": "string",
148-
"name": "string",
149-
"listeners": [
150-
{
151-
"id": "string",
152-
"name": "string"
153-
}
154-
]
148+
"name": "string"
155149
},
156150
"_links": {
157151
"self": {
Lines changed: 343 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,343 @@
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+
api:
11+
method: get
12+
path: /events
13+
name: Get events
14+
15+
---
16+
17+
# Get events
18+
19+
<p class="text-lg">
20+
<span class="font-medium">GET</span> /events
21+
</p>
22+
23+
**Returns** api usage events which give insights on what endpoints were called and, therefore,
24+
which actions were performed. API usage events include and are not limited to
25+
- creation, deletion and management of queues
26+
- creation, deletion and management of listeners
27+
- creation, deletion and management of api keys
28+
- creation and broadcasting/publising of messages
29+
30+
Returned data is always limited to the past 24 hours.
31+
32+
::: tip Authentication
33+
**The target organization for this request will be determined by the supplied access token.**
34+
35+
As a prerequisite you need to **[create an account](https://www.discue.io/registration/create-account)** and follow
36+
the onboarding process to also **create an organizatio**n and **an API key**.
37+
38+
See also: [Authentication](/getting-started/#prerequisites).
39+
:::
40+
41+
## Examples
42+
<CodeGroup><CodeGroupItem title="shell">
43+
44+
```shell
45+
curl -X GET http://api.discue.io/v1/events \
46+
-H 'Accept: application/json' \
47+
-H 'X-API-KEY: API_KEY'
48+
```
49+
50+
</CodeGroupItem>
51+
52+
<CodeGroupItem title="javascript">
53+
54+
```javascript
55+
const headers = {
56+
'Accept':'application/json',
57+
'X-API-KEY':'API_KEY'
58+
}
59+
60+
const response = await fetch('http://api.discue.io/v1/events', {
61+
method: 'GET', headers
62+
})
63+
64+
const body = await response.json()
65+
```
66+
67+
</CodeGroupItem>
68+
69+
<CodeGroupItem title="python">
70+
71+
```python
72+
import requests
73+
headers = {
74+
'Accept': 'application/json',
75+
'X-API-KEY': 'API_KEY'
76+
}
77+
78+
r = requests.get('http://api.discue.io/v1/events', headers = headers)
79+
```
80+
81+
</CodeGroupItem>
82+
83+
<CodeGroupItem title="go">
84+
85+
```go
86+
package main
87+
88+
import (
89+
"bytes"
90+
"net/http"
91+
)
92+
93+
func main() {
94+
95+
headers := map[string][]string{
96+
"Accept": []string{"application/json"},
97+
"X-API-KEY": []string{"API_KEY"},
98+
}
99+
100+
data := bytes.NewBuffer([]byte{jsonReq})
101+
req, err := http.NewRequest("GET", "http://api.discue.io/v1/events", data)
102+
req.Header = headers
103+
104+
client := &http.Client{}
105+
resp, err := client.Do(req)
106+
}
107+
```
108+
109+
</CodeGroupItem>
110+
111+
</CodeGroup>
112+
113+
## Parameters
114+
|Name|In|Type|Required|Description|
115+
|---|---|---|---|---|
116+
|pretty|query|boolean||Return the response pretty printed|
117+
|events|query|string||Limit the returned array to a certain number of elements|
118+
|limit|query|number||Limit the returned array to a certain number of elements|
119+
|startAfter|query|number(int64)||Return only elements that were stored after the given timestamp. Must be used in conjunction with startAfterId to have an effect|
120+
|startAfterId|query|[ResourceId](#schemaresourceid)||Must be used in conjunction with startAfterId to have an effect|
121+
122+
## Enumerated Values
123+
124+
|Parameter|Value|
125+
|---|---|
126+
|events|all|
127+
|events|api_keys|
128+
|events|listeners|
129+
|events|messages|
130+
|events|queues|
131+
132+
## Responses
133+
134+
::: tip 200 Response
135+
:::
136+
137+
```json
138+
{
139+
"events": [
140+
{
141+
"id": "string",
142+
"type": "api_key_added",
143+
"stored_at": 1657027948150,
144+
"client": {
145+
"id": "string"
146+
},
147+
"message": {
148+
"id": "string",
149+
"name": "string"
150+
},
151+
"api_key": {
152+
"id": "string",
153+
"name": "string"
154+
},
155+
"queue": {
156+
"id": "string",
157+
"name": "string"
158+
},
159+
"listener": {
160+
"id": "string",
161+
"name": "string"
162+
}
163+
}
164+
],
165+
"_links": {
166+
"self": {
167+
"href": "https://api.discue.io/events"
168+
}
169+
}
170+
}
171+
```
172+
173+
::: tip 400 Response
174+
:::
175+
176+
```json
177+
{
178+
"title": "Bad Request",
179+
"status": 400
180+
}
181+
```
182+
183+
::: tip 401 Response
184+
:::
185+
186+
```json
187+
{
188+
"title": "Unauthorized",
189+
"status": 401
190+
}
191+
```
192+
193+
::: tip 402 Response
194+
:::
195+
196+
```json
197+
{
198+
"title": "Payment Required",
199+
"status": 402
200+
}
201+
```
202+
203+
::: tip 403 Response
204+
:::
205+
206+
```json
207+
{
208+
"title": "Forbidden",
209+
"status": 403
210+
}
211+
```
212+
213+
::: tip 404 Response
214+
:::
215+
216+
```json
217+
{
218+
"title": "Not Found",
219+
"status": 404
220+
}
221+
```
222+
223+
::: tip 405 Response
224+
:::
225+
226+
```json
227+
{
228+
"title": "Method Not Allowed",
229+
"status": 405
230+
}
231+
```
232+
233+
::: tip 406 Response
234+
:::
235+
236+
```json
237+
{
238+
"title": "Not Acceptable",
239+
"status": 406
240+
}
241+
```
242+
243+
::: tip 409 Response
244+
:::
245+
246+
```json
247+
{
248+
"title": "Conflict",
249+
"status": 409
250+
}
251+
```
252+
253+
::: tip 415 Response
254+
:::
255+
256+
```json
257+
{
258+
"title": "Unsupported Media Type",
259+
"status": 415
260+
}
261+
```
262+
263+
::: tip 422 Response
264+
:::
265+
266+
```json
267+
{
268+
"title": "Unprocessable Entity",
269+
"status": 422
270+
}
271+
```
272+
273+
::: tip 423 Response
274+
:::
275+
276+
```json
277+
{
278+
"title": "Locked",
279+
"status": 423
280+
}
281+
```
282+
283+
::: tip 429 Response
284+
:::
285+
286+
```json
287+
{
288+
"title": "Too Many Requests",
289+
"status": 429
290+
}
291+
```
292+
293+
::: tip 500 Response
294+
:::
295+
296+
```json
297+
{
298+
"title": "Internal Server Error",
299+
"status": 500
300+
}
301+
```
302+
303+
::: tip 501 Response
304+
:::
305+
306+
```json
307+
{
308+
"title": "Not Implemented",
309+
"status": 501
310+
}
311+
```
312+
313+
::: tip 503 Response
314+
:::
315+
316+
```json
317+
{
318+
"title": "Service Unavailable",
319+
"status": 503
320+
}
321+
```
322+
323+
|Status|Meaning|Description|Schema|
324+
|---|---|---|---|
325+
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Ok|[GetEventsResponse](#geteventsresponse)|
326+
|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad Request|Inline|
327+
|401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|Unauthorized|Inline|
328+
|402|[Payment Required](https://tools.ietf.org/html/rfc7231#section-6.5.2)|Payment Required|Inline|
329+
|403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|Forbidden|Inline|
330+
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not Found|Inline|
331+
|405|[Method Not Allowed](https://tools.ietf.org/html/rfc7231#section-6.5.5)|Method Not Allowed|Inline|
332+
|406|[Not Acceptable](https://tools.ietf.org/html/rfc7231#section-6.5.6)|Not Acceptable|Inline|
333+
|409|[Conflict](https://tools.ietf.org/html/rfc7231#section-6.5.8)|Conflict|Inline|
334+
|415|[Unsupported Media Type](https://tools.ietf.org/html/rfc7231#section-6.5.13)|Unsupported Media Type|Inline|
335+
|422|[Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3)|Unprocessable Entity|Inline|
336+
|423|[Locked](https://tools.ietf.org/html/rfc2518#section-10.4)|Locked|Inline|
337+
|429|[Too Many Requests](https://tools.ietf.org/html/rfc6585#section-4)|Too Many Requests|Inline|
338+
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|Inline|
339+
|501|[Not Implemented](https://tools.ietf.org/html/rfc7231#section-6.6.2)|Not Implemented|Inline|
340+
|503|[Service Unavailable](https://tools.ietf.org/html/rfc7231#section-6.6.4)|Service Unavailable|Inline|
341+
342+
---
343+

0 commit comments

Comments
 (0)