Get the counts for unread notifications of the user
GET/notification-unread-counts/
v2
GET
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.
Request
No request parameters.
Responses
Usage examples
- cURL
- JavaScript SDK
- PHP SDK
$ 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();