Intra-project API

更新时间:
复制 MD 格式

Use the intra-project API node to call a deployed HTTP service from within the same project. This node serves as an intermediate logic step in the current business service.

Prerequisites

You have created a business service. For more information, see Create a business service.

Node configuration

In the business logic editor, select the corresponding function node from the Nodes panel to configure the service flow.

Parameter Description
node name The name of the node. The name can contain Chinese characters, English letters, numbers, and underscores (_), and cannot exceed 30 characters.
API Select a deployed API from the project.

After you select an API, click View API details to view its name, request method, request URL, and request parameters.

API request parameters Enter values for the request parameters of the selected API.

To use dynamic values from an upstream node, use the following expressions:

  • Use {{payload.parameter_name}} to reference an output parameter from the previous node.
  • Use {{query.parameter_name}} to reference an output parameter from the service input node.
  • Use {{node.nodeId.parameter_name}} to reference an output parameter from a specific node identified by its ID.

Example

{
   "productKey": "{{payload.productKey}}",  // The previous node's output is {productKey: 'value'}. This gets the value of productKey.
   "deviceName": "{{query.deviceName}}", // The service input node defines a parameter named deviceName. This gets the value of deviceName.
   "pageNum": "{{node.node_399591c0.pageNum}}" // The node with the ID node_399591c0 has an output of {pageNum: 10}. This gets the value of pageNum.
}

To reference a nested value within a parameter, use dot notation.

For example, {{payload.props.PM10.value}} references the value of the PM10 property within the props object from the previous node's output.

Similarly, {{query.deviceContext.deviceName}} references the deviceName variable within the deviceContext object from the output of the service input node.

Node output

The output of the intra-project API node is identical to the output of the API it calls.

Example

{"test": "test"}