Versions Compared

Key

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

1. Create a calculation logic with input parameters

Assuming Creating a calculation logic 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:

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

Now create execute a calculation logic , that which returns any some 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:

paste-code-macro
languagexml
themeDefault
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

...