API – Validate a Calculation

action – validcalc

This call is used to validate the syntax of a calculation. Note that it does not test whether any field/variable names in the calculation are valid fields of a particular data record, since calculations can be used in situations where any variable name could be passed as part of override data. This test is therefore solely checking the syntax of a calculation, including the validity of any function calls within the calculation.

Note that the available functions and their syntax should not vary by account, but it is still necessary to pass an account and apikey to pass standard API calling security.

Sample Request

{ "account": *** your account id ***, "apikey": "*** your api key ***", "action": "validcalc", "calc": "proper(FirstName)" }

Sample Response

{ "success": true }

If a calculation’s syntax is not valid, an error message will state the first issue found.

Sample Request

{ "account": *** your account id ***, "apikey": "*** your api key ***", "action": "validcalc", "calc": "proper()" }

Sample Response

{ "success": false, "errormsg": "Wrong number of arguments to proper (0 given, 1 expected)" }