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.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes, unless value=1 and plan is specified. | None. |
auth_password | String | Authentication password. | Yes, unless value=1 and plan is specified. | None. |
name | String | Name of custom setting. | Yes | |
encoding | String | "base64" to return value, default, and help (where set) fields base64 encoded, "raw" to return raw data. | No | "raw" |
language | String | Language code. | No | Default language. |
max_level | Integer | Maximum customer depth. -1 for unlimited. | No | -1 |
min_level | Integer | Minimum customer depth. | No | 0 |
plan | Integer | ID of rate plan. | No | Rate plan authentication user is on. |
template | Integer | 1 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. | No | 0 |
value | Integer | 1 to return only value of custom setting, 0 to return full data. | No | 0 |
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
Code | Description |
---|---|
200 | Success. |
400 | Invalid input parameters specified. Check the key and message fields for more details. |
401 | The authentication details provided are invalid. |
402 | Your 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
Version | Changes |
---|---|
4.0 | template input parameter added. 404 error code removed, and default value returned if not set in database. |
3.13 | Function added. |