JSON API » preferences » preferences/get

Gets the value of a preference for the authentication user.

Input parameters

Requires authentication and the user role privilege.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
nameStringName of preference to get.Yes
defaultStringA default value to return if not yet set.NoEmpty string.

Responses

CodeDescription
200Success.
401The authentication details provided are invalid.
402Your role does not allow this.

Data returned

Value of preference.

Example: With required parameters

http://enswitch.example.com/api/json/preferences/get/?auth_username=user;auth_password=password;name=phone

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "value":"1234567" } }

Change history

VersionChanges
3.13Function added.