API – Get/Set a Config Value

action – config

Configuration values are variables that are set at the Account level in PYXI. Whilst there may be some specific values that are referred to within the application’s own logic, there is no fundamental restriction on the number of config values that can be set or the alpha-numeric names they can be given.

Typically, you may wish to use config values where there is an account-specific value that needs to be retained e.g. the customer/account record number to which this account relates in another application, so that this config value can then be called with a calculation from within Templates or ActionScripts e.g. within Rules, WebHooks etc. using the getConfig function

Set a Config Value

Sample Request

{ "account": *** your account id ***, "apikey": "*** your api key ***", "action": "config", "name": "WebHookRoot", "value": "https://myapp.com/webhooks/" }

Sample Response

{ "success": true, "value": "https://myapp.com/webhooks/" }

Get a Config Value

Sample Request

{ "account": *** your account id ***, "apikey": "*** your api key ***", "action": "config", "name": "WebHookRoot" }

Sample Response

{ "success": true, "value": "https://myapp.com/webhooks/" }

This value can now be retrieved inside a script, template etc. e.g.

{getConfig("WebHookRoot")}