...
...
...
Creating a calculation logic
...
Assuming as a REST API for Postman Request consists of these steps:
Table of Contents | ||
---|---|---|
|
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:
paste-code-macro | |
---|---|
language | xml |
theme | Default |
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 |
...
https://staging.pricefx.eu/pricefx/partition_name/formulamanager.executeformula/logic_name | |
Authorization |
...
type | No Auth |
Headers |
...
Add |
...
two new pairs:
|
Request body |
...
The above JSON request |
The response result will look like this:
paste-code-macro | |
---|---|
language | xml |
Default | |
title | Request 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
...