Zum Hauptinhalt springen

Get the counts for unread notifications of the user

GET/v2/notification-unread-counts
API-Version
v2
Request-Methode
GET
Operation-ID
notifications-count-unread-notifications

The user is determined by the access token used. Lighter weight route instead of getting all unread notifications and count yourself. The counts are computed from at most 500 unread notifications.

Request​

Keine Request-Parameter.

Responses​

Format
application/json
Beschreibung

Counts of unread notifications

  • errorinteger (≥ 0)required
  • infointeger (≥ 0)required
  • successinteger (≥ 0)required
  • totalinteger (≥ 0)required
  • warninginteger (≥ 0)required
Content-Type: application/json

{
"error": 123,
"info": 123,
"success": 123,
"total": 123,
"warning": 123
}
{
"properties": {
"error": {
"minimum": 0,
"type": "integer"
},
"info": {
"minimum": 0,
"type": "integer"
},
"success": {
"minimum": 0,
"type": "integer"
},
"total": {
"minimum": 0,
"type": "integer"
},
"warning": {
"minimum": 0,
"type": "integer"
}
},
"required": [
"total",
"success",
"info",
"warning",
"error"
],
"type": "object"
}

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/notification-unread-counts
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.notificationsCountUnreadNotifications({});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\Notification\NotificationsCountUnreadNotifications\NotificationsCountUnreadNotificationsRequest;

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

$request = (new NotificationsCountUnreadNotificationsRequest());
$response = $client->notification()->notificationsCountUnreadNotifications($request);

var_dump($response->getBody();

Auf dieser Seite