Formula - Run formula validation.

API Url

Use it to run validation for formulas

POST
http://localhost:16010/ProMarkREST/web/Formula/validate

Permissions: user

Request headers

FieldTypeDescription
Accept-LanguageoptionalString

=en-GB Language use for localization.

X-ClientoptionalString

=Client type.

Allowed values:"Portal""Mobile""Admin"
X-RoleoptionalNumber

ProMark role (1: Employee, 2: User).

Allowed values:{12}
X-WebPart-IdoptionalNumber

Unique web-part identifier.

Parameter

FieldTypeDescription
  dataObject

Object containg data to be uploaded.

    formulaString

The formula that needs to be validated

    variablesObject[]

A list of variables used to validate the formula

      descriptionString

The description of the variable

      nameString

The name of the variable

      typeString

The type of the variable

Request example:

{
"request": {
"data": {
"formula": "formula"
"variables": [
{
"name": "variableName",
"description": "variableDescription",
"type": "varibaleType",
},
...
]
}
}
}

Success 200

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data.

    messageString

The error mesage resulted from the formula validation

  messageoptionalObject

Object containing response messages.

    codeNumber

Message code.

    textString

Message text.

    typeString

Type of message.

Allowed values:"warning""info"

Response example:

HTTP/1.1 200 OK
{
"response": {
"data": {
"errorMessage": "validation error message that should be displayed"
}
}
}

Error 4xx

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data (empty).

  errorCodeNumber

Error code.

  errorMessageString

Error description.