Zum Hauptinhalt springen

List all unread notifications

GET/v2/notifications
API-Version
v2
Request-Methode
GET
Operation-ID
notifications-list-notifications

Sorted by creation date, descending, unless a different sort is requested.

Request​

Responses​

Response-Header
  • X-Pagination-Limitinteger

    The limit used to select the resources for the response

  • X-Pagination-Skipinteger

    The number of skipped items

  • X-Pagination-Pagenumber

    The calculate page of the list response. Refer to parameters to learn more.

  • X-Pagination-TotalCountinteger

    The total amount of items available in the remote ressource. Use this value in combination with the limit to calculate the available pages.

Format
application/json
Beschreibung

List of notifications

  • Array[
    • *object
      • createdAtstring (date-time)required
      • idstring (uuid)required
      • readbooleanrequired
      • referenceobjectrequired
        • aggregatestringrequired
        • domainstringrequired
        • idstringrequired
        • parentsArray von object
          • Array[
            • *object
              • aggregatestringrequired
              • domainstringrequired
              • idstringrequired
            ]
      • severitystring (einer von: success, info, warning, error)required
      • typestringrequired
    ]
Content-Type: application/json

[
{
"createdAt": "1985-10-26T01:21:00.000Z",
"id": "f0f86186-0a5a-45b2-aa33-502777496347",
"read": true,
"reference": {
"aggregate": "string",
"domain": "string",
"id": "string",
"parents": [
{
"aggregate": "string",
"domain": "string",
"id": "string"
}
]
},
"severity": "success",
"type": "string"
}
]
{
"items": {
"properties": {
"createdAt": {
"format": "date-time",
"type": "string"
},
"id": {
"format": "uuid",
"type": "string"
},
"read": {
"type": "boolean"
},
"reference": {
"properties": {
"aggregate": {
"type": "string"
},
"domain": {
"type": "string"
},
"id": {
"type": "string"
},
"parents": {
"items": {
"properties": {
"aggregate": {
"type": "string"
},
"domain": {
"type": "string"
},
"id": {
"type": "string"
}
},
"required": [
"id",
"aggregate",
"domain"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"id",
"aggregate",
"domain"
],
"type": "object"
},
"severity": {
"enum": [
"success",
"info",
"warning",
"error"
],
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"id",
"type",
"reference",
"severity",
"read",
"createdAt"
],
"type": "object"
},
"type": "array"
}

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/notifications?status=unread&severity=success&type=string&type-not=string&referenceId=f0f86186-0a5a-45b2-aa33-502777496347&referenceDomain=string&referenceAggregate=string&limit=50&page=1&sort=createdAt&order=asc
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";

const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.notification.notificationsListNotifications({
"queryParameters": {
"status": "unread",
"severity": [
"success"
],
"type": [
"string"
],
"type-not": [
"string"
],
"referenceId": "f0f86186-0a5a-45b2-aa33-502777496347",
"referenceDomain": "string",
"referenceAggregate": "string",
"limit": 50,
"page": 1,
"sort": "createdAt",
"order": "asc"
}
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\Notification\NotificationsListNotifications\NotificationsListNotificationsRequest;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

$request = (new NotificationsListNotificationsRequest())
->withStatus("unread")
->withSeverity(["success"])
->withType(["string"])
->withTypeNot(["string"])
->withReferenceId("f0f86186-0a5a-45b2-aa33-502777496347")
->withReferenceDomain("string")
->withReferenceAggregate("string")
->withLimit(50)
->withPage(1)
->withSort("createdAt")
->withOrder("asc");
$response = $client->notification()->notificationsListNotifications($request);

var_dump($response->getBody();

Auf dieser Seite