User settings¶
CRUD actions for user settings.
settings object¶
{
"time_zone": "Europe/Amsterdam",
"locale": "nl_NL",
"measurement_system": "metric",
"date_format": "ddMMyyyy_dots",
"hour_mode": "TWENTY_FOUR_HOURS",
"geocoder": "osm",
"route_provider": "google",
"translit": false
}
time_zone
- enum. ISO timezone ID.locale
- enum. Locale code.measurement_system
- enum. Measurement system. Can be "metric", "imperial", "us", "metric_gal_us" or "nautical".date_format
- Optional enum. Date representation. Can be "ddMMyyyy_dots"("dd.MM.yyyy", "01.12.2021"), "ddMMyyyy_slashes"("dd/MM/yyyy", "01/12/2021"), "MMddyyyy_hyphens"("MM-dd-yyyy", "12-01-2021"), "yyyyMMdd_hyphens"("yyyy-MM-dd", "2021-12-01"), "dMMMy"("d MMM y", "1 Dec 2021") or "dMMMMy"("d MMMM y", "1 December 2021")hour_mode
- Optional enum. Time representation. Can be "TWENTY_FOUR_HOURS" (24-hour clock, "HH:mm" or "HH:mm:ss", "17:45"/"17:45:46") or "TWELVE_HOURS" (12-hour clock, "h:mm a" or "h:mm:ss a", "5:45 PM"/"5:45:46 PM")geocoder
- enum. Preferred geocoder type. Can be "google", "yandex", "progorod", "osm" or "locationiq".route_provider
- enum. Preferred route finding provider. Can be "google", "progorod" or "osrm".translit
- boolean.true
if sms notification should be transliterated,false
otherwise.
balance_alert_settings
type is JSON object:
{
"emails": ["email1@example.com", "email2@example.com"]
}
emails
- string array. List of emails to send alert message about balance. Empty array means disclaimer of notifications.
file_storage_settings
type is JSON object:
{
"auto_overwrite": true
}
auto_overwrite
- boolean. Iftrue
new files will replace old ones when file storage is full. Default isfalse
.
API actions¶
API path: /user/settings
.
read
¶
Reads current user's settings.
Parameters¶
Only API key hash
.
Examples¶
curl -X POST 'https://api.navixy.com/v2/user/settings/read' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b"}'
https://api.navixy.com/v2/user/settings/read?hash=a6aa75587e5c59c32d347da438505fc3
Response¶
{
"success": true,
"settings": {
"time_zone": "Europe/Amsterdam",
"locale": "nl_NL",
"measurement_system": "metric",
"geocoder": "osm",
"route_provider": "google",
"translit": false
},
"file_storage_settings": {
"auto_overwrite": true
},
"balance_alert_settings": {
"emails": ["email1@example.com", "email2@example.com"]
},
"first_user_balance_warning_period": "7d",
"second_user_balance_warning_period": "2d"
}
first_user_balance_warning_period
- string. The first interval to send alert. "7d" means send the first alert warning 7 days before.second_user_balance_warning_period
- string. The second interval to send alert. Send the second alert warning n days before.- Where
settings
,balance_alert_settings
andfile_storage_settings
described above.
required sub-user rights for balance_alert_settings
and file_storage_settings
fields: admin
(available only to master users).
update
¶
Update current user's settings.
required sub-user rights for balance_alert_settings
and file_storage_settings
: admin
(available only to master users).
Parameters¶
name | description | type |
---|---|---|
time_zone | ISO timezone ID. | enum |
locale | Locale code. | enum |
measurement_system | Measurement system. Can be "metric", "imperial", "us", "metric_gal_us" or "nautical". | enum |
geocoder | Preferred geocoder type. Can be "google", "yandex", "progorod", "osm" or "locationiq". | enum |
route_provider | Preferred route finding provider. Can be "google", "progorod" or "osrm". | enum |
translit | true if sms notification should be transliterated, false otherwise. | boolean |
balance_alert_settings | Object containing array of emails. | JSON object |
file_storage_settings | Object containing file storage settings. | JSON object |
Example¶
curl -X POST 'https://api.navixy.com/v2/user/settings/update' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "time_zone": "Europe/Amsterdam", "locale": "nl_NL", "measurement_system": "metric", "geocoder": "osm", "route_provider": "google", "translit": false, "balance_alert_settings": {"emails": ["email1@example.com", "email2@example.com"]}, "file_storage_settings": {"auto_overwrite": true}}'
Response¶
{ "success": true }
Errors¶
- General types only.
file_storage/update
¶
Updates current user's file storage settings.
required sub-user rights: admin
(available only to master users).
Parameters¶
name | description | type |
---|---|---|
file_storage_settings | Object containing file storage settings. | JSON object |
Example¶
curl -X POST 'https://api.navixy.com/v2/user/settings/file_storage/update' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "file_storage_settings": {"auto_overwrite": true}}'
Errors¶
- 13 – Operation not permitted – if user has insufficient rights.
Last update: October 16, 2024