curl --request GET \
--url https://api.example.com/api/notification/list \
--header 'Authorization: <authorization>'{
"notifications": [
{
"id": "<string>",
"type": "<string>",
"message": "<string>",
"createdAt": "<string>",
"isRead": true
}
]
}Retrieve all notifications for the authenticated user
curl --request GET \
--url https://api.example.com/api/notification/list \
--header 'Authorization: <authorization>'{
"notifications": [
{
"id": "<string>",
"type": "<string>",
"message": "<string>",
"createdAt": "<string>",
"isRead": true
}
]
}Bearer YOUR_ACCESS_TOKENinfo, warning, or error{
"notifications": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"type": "warning",
"message": "Your milk expires in 2 days",
"createdAt": "2026-03-04T10:30:00",
"isRead": false
},
{
"id": "650e8400-e29b-41d4-a716-446655440001",
"type": "info",
"message": "Product scanned successfully: Organic Yogurt",
"createdAt": "2026-03-03T15:20:00",
"isRead": true
},
{
"id": "750e8400-e29b-41d4-a716-446655440002",
"type": "error",
"message": "Unable to detect product expiry date",
"createdAt": "2026-03-02T09:15:00",
"isRead": true
}
]
}
{
"message": "No notifications found"
}
{
"detail": "Unauthorized"
}
{
"detail": "Authorization header missing or invalid."
}
type field indicates the severity and nature of the notification:
curl -X GET "https://api.expireeye.com/api/notification/list" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
const accessToken = "your-jwt-token";
fetch("https://api.expireeye.com/api/notification/list", {
method: "GET",
headers: {
"Authorization": `Bearer ${accessToken}`,
},
})
.then(response => response.json())
.then(data => {
if (data.notifications) {
console.log(`Found ${data.notifications.length} notifications`);
// Filter unread notifications
const unread = data.notifications.filter(n => !n.isRead);
console.log(`${unread.length} unread notifications`);
} else {
console.log(data.message); // "No notifications found"
}
})
.catch(error => console.error("Error:", error));
import requests
access_token = "your-jwt-token"
url = "https://api.expireeye.com/api/notification/list"
headers = {
"Authorization": f"Bearer {access_token}"
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
data = response.json()
if "notifications" in data:
notifications = data["notifications"]
print(f"Found {len(notifications)} notifications")
# Print unread notifications
unread = [n for n in notifications if not n["isRead"]]
for notif in unread:
print(f"[{notif['type'].upper()}] {notif['message']}")
else:
print(data["message"])
else:
print(f"Error: {response.status_code}")
import axios from 'axios';
interface Notification {
id: string;
type: 'info' | 'warning' | 'error';
message: string;
createdAt: string;
isRead: boolean;
}
interface NotificationsResponse {
notifications?: Notification[];
message?: string;
}
async function getNotifications(accessToken: string): Promise<void> {
try {
const response = await axios.get<NotificationsResponse>(
'https://api.expireeye.com/api/notification/list',
{
headers: {
Authorization: `Bearer ${accessToken}`,
},
}
);
if (response.data.notifications) {
const unreadCount = response.data.notifications.filter(
n => !n.isRead
).length;
console.log(`Total: ${response.data.notifications.length}`);
console.log(`Unread: ${unreadCount}`);
} else {
console.log(response.data.message);
}
} catch (error) {
console.error('Failed to fetch notifications:', error);
}
}
isRead field on the client side