Step 1: Set Up UIPath Project

  1. Launch UIPath Studio and create a New Project.
  2. Choose the Manual Automation template.
  3. Name the project and open the workflow editor.

Step 2: Create Input Variables

  1. Add three Set Variable activities to define input variables:
    • originZIP (e.g., “10001”)
    • destinationZIP (e.g., “90001”)
    • weight (e.g., “1”)
  2. Leave default values blank to allow runtime inputs.

Step 3: Construct the API Request Body

  1. Add a Set Value activity to build the JSON request body.
  2. Use the following structure:
     
    { "request": { "workspaceId": "your-workspace-id", "applicationId": "your-application-id", "inputs": { "originZIP": "{{originZIP}}", "destinationZIP": "{{destinationZIP}}", "weight": "{{weight}}" }, "outputs": ["cost"] } }
  3. Replace placeholders with dynamic input variables.

Step 4: Configure the HTTP Request

  1. Add the HTTP Request activity to the workflow.
  2. Set the properties:
    • Method: POST
    • Endpoint:
       
      https://api.spreadsheetweb.com/calculations/calculatesinglesimple

       

    • Headers:
      • Content-Type: application/json
    • Body: Reference the JSON request variable (requestBody).
  3. Ensure SSL Certification is enabled and Accept is set to JSON.

Step 5: Log the API Response

  1. Add a Log Message activity after the HTTP request.
  2. Log the Response Content from the HTTP Request activity to verify the raw response.

Step 6: Deserialize JSON Response

  1. Add a Deserialize JSON activity to convert the API response into a usable format.
  2. Map the Response Content to the JSON String field.
  3. The result will be a structured object for accessing specific fields.

Step 7: Log the Deserialized Output

  1. Add a Log Message activity.
  2. Log the specific output (e.g., cost) from the deserialized JSON object:
     
    deserializedObject("response")("outputs")("cost").ToString

    Step 8: Test the Workflow

  1. Run the automation and provide test values for:
    • originZIP
    • destinationZIP
    • weight
  2. Check the logs:
    • Ensure the API response contains the expected cost value.
    • Verify the deserialized output is accurate.