JSON API » customs » customs/get

Gets the fields of a custom setting.

Input parameters

If value and plan are not specified, requires authentication and the commerce role privilege.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes, unless value=1 and plan is specified.None.
auth_passwordStringAuthentication password.Yes, unless value=1 and plan is specified.None.
nameStringName of custom setting.Yes
encodingString"base64" to return value, default, and help (where set) fields base64 encoded, "raw" to return raw data.No"raw"
languageStringLanguage code.NoDefault language.
max_levelIntegerMaximum customer depth. -1 for unlimited.No-1
min_levelIntegerMinimum customer depth.No0
planIntegerID of rate plan.NoRate plan authentication user is on.
templateInteger1 to treat the value as a template and process any template logic, 0 not to. Only has effect if authentication is provided and value=1.No0
valueInteger1 to return only value of custom setting, 0 to return full data.No0

To get a setting for all customers recursively, do not specify min_level or max_level. To get a setting for direct customers, specify min_level=1 and max_level=1.

Responses

CodeDescription
200Success.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.

Data returned

Fields of custom setting.

Example: With authentication

http://enswitch.example.com/api/json/customs/get/?auth_username=user;auth_password=password;name=footer_text;plan=123

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "name":"footer_text", "plan":123, ... } }

Example: Without authentication

http://enswitch.example.com/api/json/customs/get/?name=footer_text;plan=123;value=1

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "value":"Example footer text" } }

Change history

VersionChanges
4.0template input parameter added. 404 error code removed, and default value returned if not set in database.
3.13Function added.