Documentation Index
Fetch the complete documentation index at: https://docs.foodsave.kz/llms.txt
Use this file to discover all available pages before exploring further.
Device API
Base path: /api/v1/notifications/devices
Overview
Register mobile and web devices for push notifications.
POST /api/v1/notifications/devices
Register an FCM device.
curl --request POST \
--url https://api.foodsave.kz/api/v1/notifications/devices \
-H 'Authorization: Bearer $USER_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"fcmToken":"fcm-abc","platform":"android","locale":"ru-KZ"}'
const response = await fetch('https://api.foodsave.kz/api/v1/notifications/devices', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.USER_TOKEN}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ fcmToken: 'fcm-abc', platform: 'android', locale: 'ru-KZ' })
})
console.log(await response.json())
import os
import requests
response = requests.post(
'https://api.foodsave.kz/api/v1/notifications/devices',
headers={'Authorization': f"Bearer {os.environ['USER_TOKEN']}"},
json={'fcmToken': 'fcm-abc', 'platform': 'android', 'locale': 'ru-KZ'}
)
print(response.json())
{ "id":"d-1", "platform":"android", "locale":"ru-KZ" }
Errors
| Code | Meaning | How to fix |
|---|
| 400 | INVALID_FCM_TOKEN | Regenerate the device token |
| 401 | UNAUTHORIZED | Provide a valid JWT |