Zum Hauptinhalt springen

Mark all notifications as read

POST/v2/notifications/actions/read-all
API-Version
v2
Request-Methode
POST
Operation-ID
notifications-read-all-notifications

Mark all notifications for the authenticated user as read.

Request​

Responses​

Format
application/json
Beschreibung

OK

  • statusstring (einer von: read, unread)required
  • updatedCountinteger (int32)required

    The number of notifications that have been updated.

Content-Type: application/json

{
"status": "read",
"updatedCount": 123
}
{
"properties": {
"status": {
"enum": [
"read",
"unread"
],
"type": "string"
},
"updatedCount": {
"description": "The number of notifications that have been updated.",
"format": "int32",
"type": "integer"
}
},
"required": [
"status",
"updatedCount"
],
"type": "object"
}

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-X POST \
-d '{}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/notifications/actions/read-all?severities=success&referenceId=f0f86186-0a5a-45b2-aa33-502777496347&referenceAggregate=string&referenceDomain=string
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.notificationsReadAllNotifications({
"data": {},
"queryParameters": {
"severities": [
"success"
],
"referenceId": "f0f86186-0a5a-45b2-aa33-502777496347",
"referenceAggregate": "string",
"referenceDomain": "string"
}
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\Notification\NotificationsReadAllNotifications\NotificationsReadAllNotificationsRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\Notification\NotificationsReadAllNotifications\NotificationsReadAllNotificationsRequestBody;

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

// TODO: Please consult the properties and constructor signature of
// NotificationsReadAllNotificationsRequestBody to learn how to construct a valid instance
$body = new NotificationsReadAllNotificationsRequestBody(/* TODO: ... */);

$request = (new NotificationsReadAllNotificationsRequest(
body: $body
))
->withSeverities(["success"])
->withReferenceId("f0f86186-0a5a-45b2-aa33-502777496347")
->withReferenceAggregate("string")
->withReferenceDomain("string");
$response = $client->notification()->notificationsReadAllNotifications($request);

var_dump($response->getBody();

Auf dieser Seite