Step 1: Set Up UIPath Project
- Launch UIPath Studio and create a New Project.
- Choose the Manual Automation template.
- Name the project and open the workflow editor.
Step 2: Create Input Variables
- Add three Set Variable activities to define input variables:
- originZIP (e.g., “10001”)
- destinationZIP (e.g., “90001”)
- weight (e.g., “1”)
- Leave default values blank to allow runtime inputs.
Step 3: Construct the API Request Body
- Add a Set Value activity to build the JSON request body.
- Use the following structure:
- Replace placeholders with dynamic input variables.
Step 4: Configure the HTTP Request
- Add the HTTP Request activity to the workflow.
- Set the properties:
- Method:
POST - Endpoint:
- Headers:
-
Content-Type: application/json
-
- Body: Reference the JSON request variable (
requestBody).
- Method:
- Ensure SSL Certification is enabled and Accept is set to
JSON.
Step 5: Log the API Response
- Add a Log Message activity after the HTTP request.
- Log the Response Content from the HTTP Request activity to verify the raw response.
Step 6: Deserialize JSON Response
- Add a Deserialize JSON activity to convert the API response into a usable format.
- Map the Response Content to the JSON String field.
- The result will be a structured object for accessing specific fields.
Step 7: Log the Deserialized Output
- Add a Log Message activity.
- Log the specific output (e.g.,
cost) from the deserialized JSON object:
- Run the automation and provide test values for:
- originZIP
- destinationZIP
- weight
- Check the logs:
- Ensure the API response contains the expected cost value.
- Verify the deserialized output is accurate.