Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

Creating a calculation logic

...

Assuming as a REST API for Postman Request consists of these steps: 

Table of Contents
maxLevel1

Create Calculation Logic with Input Parameters

Le'ts assume that we'll send the following body request like this, which we need which is needed to pass the CustomerID and ProductID:

title
paste-code-macro
languagexml
themeDefault
Request Body
{
    "data": {
        "CustomerID": "111980",
        "ProductID": "1504795"
    }
}

Now create a calculation logic , that which returns any the expected data , to and make it receive the request parameter, e.g ProductID, using api.input("ProductID").

...

Request

...

Logic with POSTMAN

At first, encode with the Base64 the combined string with this format: partition_name/username:password

Assuming that you already have Postman, let's create a new POST request with the below configuration:

Endpoint

...

...

typeNo Auth
Headers

...

Add

...

two new pairs:

  • Authorization: Basic BASED_64_ENCODED_CREDENTIALS
  • Content-Type: application/json
Request body

...

The above JSON request


The response result will look like this:

theme
paste-code-macro
languagexml
Default
titleRequest Body
{
    "response": {
        "node": "node1",
        "csrfToken": "1dtkww9y7hg8vs2qnh4u9ct0t",
        "data": [
            {
                "resultName": ...,
                "resultLabel": ...,
                "result": 
            }
        ],
        "status": 0
    }
}

...

For more details see the API Documentation: https://qa.pricefx.eu/pricefx-api/json/master.html#!/formula/executeformula

...