Versions Compared

Key

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

...

Only a logic of generic type (formulaNature is not defined) can be used as an API endpoint.

Table of Contents

HTTP Endpoint

Each custom API is implemented using a logic of generic type (formulaNature not specified) and the APIs are called using the following HTTPS endpoint:

...

Alternatively, you can also use the formulamanager.executeformulaservice API, which allows to values caching using api.global between the calls, see REST API documentation .

Inputs and Outputs

HTTP API is defined by a request in the JSON format, which contains the “data” section which contains the input fields:

...

Code Block
{
  "node" : "user1",
  "csrfToken" : ...,
  "data" : [ {
    "resultName" : ...,
    "resultLabel" : ...,
    "result" : ...,
    "excludeFromExport" ...,
    "warnings" : ...,
    "alertMessage" : ...,
    "alertType" : ...,
    "displayOptions" : ...,
    "formatType" : ...,
    "suffix" : ...,
    "resultType" : ...,
    "cssProperties" : ...,
    "userGroup" : ...,
    "resultGroup" : ...,
    "overrideValueOptions" : ...,
    "overrideAllowEmpty" : ...,
    "labelTranslations" : ...,
    "overridable" : ...,
    "overridden" : ...,
    "resultDescription" : ...,
  }, {
  ....
  } ],
  "status" : 0
}

Example: GetPrice API

In this example, you will learn how to create a very simple API that returns a price for a given list of SKUs from a price grid of a given name.

...

We suppose a limit of SKUs in each API call to be 100 at maximum.

1. Create Logic

Create a logic of generic type (no formulaNature selected) and give it a name, e.g., “GetPrice” and implement the following elements:

...

  • Integration elements – camelCase (with lower-case initial letter); to have the lower-case letter in JSON.

  • Other elements – CamelCase (with upper-case initial letter).

2. Generate Parameters

Go to the Parameters tab and define the input values:

...

Save the parameter preset for later use.

3. Call API Endpoint

Navigate to the “API” tab of the logic editor in Studio. The endpoint sits on the server, therefore select “Deploy logic” and click the green run button. The logic will get deployed and executed and then the “Renspose body” tab will show the response.

...

For the debugging purposes, if you are not using a Map or List in input values, you can also utilize the test execution of the logic by clicking the Test logic button.

Security

The user account that is used for calling the API requires PRICINGFORMULA_EXECUTE permission which is included in several user roles (the ones that may need configurator logic). If the integration account should have the minimalistic access, the View Products role is the candidate.