Home / Docs Center / Pet Feeder (ODM Case) / Settings Module
Settings Module
Project: Pet Feeder | page_id: 1732
Settings Authentication Interface Documentation
Overview
- Base path: /api
- Documentation scope: settings module interfaces in the authenticated routes
- Authentication method: request header X-Token
- Content-Type: application/json
Authentication Header
| Field | Type | Required | Description |
|---|---|---|---|
| X-Token | string | Yes | The JWT Token obtained after the user logs in |
Settings Object Field Description
| Field | Type | Description |
|---|---|---|
| userId | integer | User ID |
| feedReminder | boolean | Feeding reminder switch |
| lowFoodReminder | boolean | Insufficient food reminder switch |
| offlineReminder | boolean | Offline reminder switch |
| lowBatteryReminder | boolean | Low battery reminder switch |
| soundEnabled | boolean | Sound reminder switch |
| noDisturb | boolean | Do-not-disturb mode switch |
| noDisturbStart | string | Do-not-disturb start time, in HH:mm format |
| noDisturbEnd | string | Do-not-disturb end time, in HH:mm format |
| biometricEnabled | boolean | Biometric recognition switch |
1. Get User Settings
- Path: /api/settings/get
- Method: POST
- Authentication required: Yes
Request Body
No business parameters; an empty object can be passed:
{}
Success Response Example
{
"code": 200,
"msg": "Operation successful",
"data": {
"userId": 1,
"feedReminder": true,
"lowFoodReminder": true,
"offlineReminder": true,
"lowBatteryReminder": true,
"soundEnabled": true,
"noDisturb": false,
"noDisturbStart": "22:00",
"noDisturbEnd": "08:00",
"biometricEnabled": false
}
}
Failure Response Example
{
"code": 500,
"msg": "Failed to get the settings",
"data": null
}
2. Update User Settings
- Path: /api/settings/update
- Method: POST
- Authentication required: Yes
Request Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| feedReminder | boolean | No | Whether to enable feeding reminders |
| lowFoodReminder | boolean | No | Whether to enable insufficient food reminders |
| offlineReminder | boolean | No | Whether to enable offline reminders |
| lowBatteryReminder | boolean | No | Whether to enable low battery reminders |
| soundEnabled | boolean | No | Whether to enable sound reminders |
| noDisturb | boolean | No | Whether to enable do-not-disturb mode |
| noDisturbStart | string | No | Do-not-disturb start time; it is overwritten only when it is non-empty |
| noDisturbEnd | string | No | Do-not-disturb end time; it is overwritten only when it is non-empty |
| biometricEnabled | boolean | No | Whether to enable biometric recognition |
Request Example
{
"feedReminder": true,
"lowFoodReminder": true,
"offlineReminder": false,
"lowBatteryReminder": true,
"soundEnabled": false,
"noDisturb": true,
"noDisturbStart": "23:00",
"noDisturbEnd": "07:00",
"biometricEnabled": true
}
Success Response Example
{
"code": 200,
"msg": "Settings saved",
"data": null
}
Failure Response Example
{
"code": 400,
"msg": "Parameter error",
"data": null
}
{
"code": 400,
"msg": "Failed to save the settings",
"data": null
}
{
"code": 500,
"msg": "Failed to get the settings",
"data": null
}
Appendix
Description
- settings/get currently does not read the business request body; either an empty object or an empty body works.
- settings/update is a partial update and only overwrites the fields explicitly passed in the request.
Didn't find what you need?Contact us,Talk to our engineers directly.