Icon

2. Working with JSON

Data retrieval API endpoint

2. Working with JSON

Step 2. Filter data

  1. Connect the output of the JSON to Table node to the Table Row To Variable node.

Here the customer value from the input JSON is used as a wildcard to filter the customers from the Orders table.


Step 1. JSON input

  1. Add a Container Input (JSON) node to receive an input from the client.

  2. Configure the default JSON value to

    { "customer" : "*" }

  3. Convert the JSON with a JSON to Table node.


Step 3. JSON output

  1. Convert the filtered table with a Table to JSON node.

  2. Use a Container Output (JSON) node to send the output data to the client.

    • Select the JSON column created in the previous step.

    • Click the Fill example JSON from input data option.


Step 4. Deploy the REST API endpoint

  1. Upload the workflow to one of your KNIME Hub spaces.

  2. Create a version of the workflow.

  3. Create a service deployment of the workflow.

Step 5. Send a request to the REST API endpoint

  1. Find the endpoint URL.

  2. Send a request to the deployment's endpoint from an external tool

    • Use curl from the command line or Postman.

    • Make sure to authenticate with your application password.

Note. Use a POST request to include in the request body a JSON that specifies the customer whose orders you want to filter. For example: { "customer" : "Emma" }

The JSON response should contain the orders of that customer.

Receive value to filter for
Container Input (JSON)
Table to JSON
Return filtered table
Container Output (JSON)
JSON to Table
Filter data withcustomer as wildcard
Row Filter
Table Row to Variable
Orders
Table Creator

Nodes

Extensions

  • No modules found

Links