JSON API » configs » configs/get

Gets the fields of a configuration setting.

Input parameters

Authentication is optional for most configuration settings. If supplied, the time and person who last updated the setting will be returned. A few configuration settings containing sensitive information such as usernames and passwords require authentication and a specific role privilege. Requesting these configuration settings without the correct authentication will return 401 or 402.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.NoNone.
auth_passwordStringAuthentication password.NoNone.
nameStringName of configuration setting to get.Yes
defaultStringA default value to return if the setting does not exist. If not set and the configuration setting does not exist, a 404 error is returned.NoNone.

Responses

CodeDescription
200Success.
401The authentication details provided are invalid.
402Your role does not allow this.
404The configuration setting does not exist, and no default was provided.

Data returned

Fields of the configuration setting.

Example: With required parameters

http://enswitch.example.com/api/json/configs/get/?name=asterisk_version

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "name":"asterisk_version", "value":"11", ... } }

Change history

VersionChanges
4.0Authentication required for sensitive configuration settings added.
3.13Function added.