Skip to content

Commit

Permalink
feat: update from latest api spec
Browse files Browse the repository at this point in the history
  • Loading branch information
stfsy committed Aug 4, 2022
1 parent 8f33a31 commit 2255cee
Show file tree
Hide file tree
Showing 4 changed files with 346 additions and 21 deletions.
8 changes: 1 addition & 7 deletions docs/api-reference/queues/create-a-queue.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,7 @@ func main() {
{
"queue": {
"id": "string",
"name": "string",
"listeners": [
{
"id": "string",
"name": "string"
}
]
"name": "string"
},
"_links": {
"self": {
Expand Down
8 changes: 1 addition & 7 deletions docs/api-reference/queues/get-a-queue-by-id.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,7 @@ func main() {
{
"queue": {
"id": "string",
"name": "string",
"listeners": [
{
"id": "string",
"name": "string"
}
]
"name": "string"
},
"_links": {
"self": {
Expand Down
8 changes: 1 addition & 7 deletions docs/api-reference/queues/update-a-queue-by-id.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,7 @@ func main() {
{
"queue": {
"id": "string",
"name": "string",
"listeners": [
{
"id": "string",
"name": "string"
}
]
"name": "string"
},
"_links": {
"self": {
Expand Down
343 changes: 343 additions & 0 deletions docs/api-reference/usage-events/get-events.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,343 @@
---
title: discue scheduling and queueing API v0.1.0
language_tabs:
- shell: curl
- javascript: JavaScript
- python: Python
- go: Go
toc_footers: []
includes: []
api:
method: get
path: /events
name: Get events

---

# Get events

<p class="text-lg">
<span class="font-medium">GET</span> /events
</p>

**Returns** api usage events which give insights on what endpoints were called and, therefore,
which actions were performed. API usage events include and are not limited to
- creation, deletion and management of queues
- creation, deletion and management of listeners
- creation, deletion and management of api keys
- creation and broadcasting/publising of messages

Returned data is always limited to the past 24 hours.

::: tip Authentication
**The target organization for this request will be determined by the supplied access token.**

As a prerequisite you need to **[create an account](https://www.discue.io/registration/create-account)** and follow
the onboarding process to also **create an organizatio**n and **an API key**.

See also: [Authentication](/getting-started/#prerequisites).
:::

## Examples
<CodeGroup><CodeGroupItem title="shell">

```shell
curl -X GET http://api.discue.io/v1/events \
-H 'Accept: application/json' \
-H 'X-API-KEY: API_KEY'
```

</CodeGroupItem>

<CodeGroupItem title="javascript">

```javascript
const headers = {
'Accept':'application/json',
'X-API-KEY':'API_KEY'
}

const response = await fetch('http://api.discue.io/v1/events', {
method: 'GET', headers
})

const body = await response.json()
```

</CodeGroupItem>

<CodeGroupItem title="python">

```python
import requests
headers = {
'Accept': 'application/json',
'X-API-KEY': 'API_KEY'
}

r = requests.get('http://api.discue.io/v1/events', headers = headers)
```

</CodeGroupItem>

<CodeGroupItem title="go">

```go
package main

import (
"bytes"
"net/http"
)

func main() {

headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-KEY": []string{"API_KEY"},
}

data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://api.discue.io/v1/events", data)
req.Header = headers

client := &http.Client{}
resp, err := client.Do(req)
}
```

</CodeGroupItem>

</CodeGroup>

## Parameters
|Name|In|Type|Required|Description|
|---|---|---|---|---|
|pretty|query|boolean||Return the response pretty printed|
|events|query|string||Limit the returned array to a certain number of elements|
|limit|query|number||Limit the returned array to a certain number of elements|
|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|
|startAfterId|query|[ResourceId](#schemaresourceid)||Must be used in conjunction with startAfterId to have an effect|

## Enumerated Values

|Parameter|Value|
|---|---|
|events|all|
|events|api_keys|
|events|listeners|
|events|messages|
|events|queues|

## Responses

::: tip 200 Response
:::

```json
{
"events": [
{
"id": "string",
"type": "api_key_added",
"stored_at": 1657027948150,
"client": {
"id": "string"
},
"message": {
"id": "string",
"name": "string"
},
"api_key": {
"id": "string",
"name": "string"
},
"queue": {
"id": "string",
"name": "string"
},
"listener": {
"id": "string",
"name": "string"
}
}
],
"_links": {
"self": {
"href": "https://api.discue.io/events"
}
}
}
```

::: tip 400 Response
:::

```json
{
"title": "Bad Request",
"status": 400
}
```

::: tip 401 Response
:::

```json
{
"title": "Unauthorized",
"status": 401
}
```

::: tip 402 Response
:::

```json
{
"title": "Payment Required",
"status": 402
}
```

::: tip 403 Response
:::

```json
{
"title": "Forbidden",
"status": 403
}
```

::: tip 404 Response
:::

```json
{
"title": "Not Found",
"status": 404
}
```

::: tip 405 Response
:::

```json
{
"title": "Method Not Allowed",
"status": 405
}
```

::: tip 406 Response
:::

```json
{
"title": "Not Acceptable",
"status": 406
}
```

::: tip 409 Response
:::

```json
{
"title": "Conflict",
"status": 409
}
```

::: tip 415 Response
:::

```json
{
"title": "Unsupported Media Type",
"status": 415
}
```

::: tip 422 Response
:::

```json
{
"title": "Unprocessable Entity",
"status": 422
}
```

::: tip 423 Response
:::

```json
{
"title": "Locked",
"status": 423
}
```

::: tip 429 Response
:::

```json
{
"title": "Too Many Requests",
"status": 429
}
```

::: tip 500 Response
:::

```json
{
"title": "Internal Server Error",
"status": 500
}
```

::: tip 501 Response
:::

```json
{
"title": "Not Implemented",
"status": 501
}
```

::: tip 503 Response
:::

```json
{
"title": "Service Unavailable",
"status": 503
}
```

|Status|Meaning|Description|Schema|
|---|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Ok|[GetEventsResponse](#geteventsresponse)|
|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad Request|Inline|
|401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|Unauthorized|Inline|
|402|[Payment Required](https://tools.ietf.org/html/rfc7231#section-6.5.2)|Payment Required|Inline|
|403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|Forbidden|Inline|
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not Found|Inline|
|405|[Method Not Allowed](https://tools.ietf.org/html/rfc7231#section-6.5.5)|Method Not Allowed|Inline|
|406|[Not Acceptable](https://tools.ietf.org/html/rfc7231#section-6.5.6)|Not Acceptable|Inline|
|409|[Conflict](https://tools.ietf.org/html/rfc7231#section-6.5.8)|Conflict|Inline|
|415|[Unsupported Media Type](https://tools.ietf.org/html/rfc7231#section-6.5.13)|Unsupported Media Type|Inline|
|422|[Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3)|Unprocessable Entity|Inline|
|423|[Locked](https://tools.ietf.org/html/rfc2518#section-10.4)|Locked|Inline|
|429|[Too Many Requests](https://tools.ietf.org/html/rfc6585#section-4)|Too Many Requests|Inline|
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|Inline|
|501|[Not Implemented](https://tools.ietf.org/html/rfc7231#section-6.6.2)|Not Implemented|Inline|
|503|[Service Unavailable](https://tools.ietf.org/html/rfc7231#section-6.6.4)|Service Unavailable|Inline|

---

0 comments on commit 2255cee

Please sign in to comment.