> ## Documentation Index
> Fetch the complete documentation index at: https://koreai-ai-for-work-dev.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Using the DHL Action Templates

<Badge icon="arrow-left" color="gray">[Back to Actions Integrations](/ai-for-service/integrations/overview#actions)</Badge>

Use prebuilt DHL action templates to auto-create dialog tasks.

**Prerequisites:** Configure [DHL](/ai-for-service/integrations/actions/configuring-the-dhl-action) and [install templates](/ai-for-service/integrations/actions/configuring-the-dhl-action#install-dhl-action-templates) before proceeding.

Navigate to **Automation AI > Use Cases > Dialogs**, then click the auto-created dialog to open the canvas.

***

## Supported Actions

| Action         | Description                                         | Method |
| -------------- | --------------------------------------------------- | ------ |
| Track Shipment | Tracks a shipment using the DHL tracking ID         | GET    |
| Find Locations | Retrieves locations by country code and postal code | GET    |

***

## Track Shipment

1. Install the template from [DHL Templates](/ai-for-service/integrations/actions/configuring-the-dhl-action#install-dhl-action-templates).

2. The **Track Shipment** dialog task is added with:

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/dhl-action-img12-tem-img4.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=74e8d3366d9430a26ae6ada5fcf31cd4" alt="Dialog task added" width="1469" height="841" data-path="ai-for-service/integrations/actions/images/dhl-action-img12-tem-img4.png" />

   * **trackShipment** - User intent to track a shipment by DHL ID.

   * **trackingNumber** - Entity node for the tracking number.

   * **trackShipmentService** - Bot action service to track the shipment. Optionally click **Edit Request**:

     <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/dhl-tem-img5.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=6d998d4d9a344c12080a7e7ff650f415" alt="Request" width="1916" height="909" data-path="ai-for-service/integrations/actions/images/dhl-tem-img5.png" />

     Click **+Add Response**:

     <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/dhl-tem-img6.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=3b65de56a7f60e6a45716eac74c48650" alt="Response" width="1904" height="911" data-path="ai-for-service/integrations/actions/images/dhl-tem-img6.png" />

     **Sample Response:**

     ```json theme={null}
     {
       "shipments": [
         {
           "id": "7777777770",
           "service": "express",
           "origin": { "address": { "addressLocality": "-" } },
           "destination": { "address": { "addressLocality": "-" } },
           "status": {
             "timestamp": "2023-05-23T12:30:00",
             "location": { "address": { "addressLocality": "NUREMBERG - GERMANY" } },
             "statusCode": "transit",
             "description": "Arrived at DHL Delivery Facility NUREMBERG - GERMANY"
           },
           "events": [
             { "description": "Arrived at DHL Delivery Facility NUREMBERG - GERMANY" },
             { "description": "Shipment picked up" }
           ]
         }
       ]
     }
     ```

   * **trackShipmentMessage** - Message node to display results.

3. Click **Train**, then **Talk to Bot** to test.

4. Follow prompts to track a shipment.

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/dhl-tem-img7.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=0ca70ce913647b865b26c8937871cccb" alt="VA console prompt" width="650" height="824" data-path="ai-for-service/integrations/actions/images/dhl-tem-img7.png" />

***

## Find Locations

1. Install the template from [DHL Templates](/ai-for-service/integrations/actions/configuring-the-dhl-action#install-dhl-action-templates).

2. The **Find Locations** dialog task is added with:

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/dhl-tem-img8.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=dc911cac765ae63ffde2c4120ec7e940" alt="Dialog task added" width="1491" height="903" data-path="ai-for-service/integrations/actions/images/dhl-tem-img8.png" />

   * **findLocations** - User intent to find locations by coordinates.

   * **countryCode** and **postalCode** - Entity nodes for country and postal codes.

   * **findLocationsService** - Bot action service to find locations. Optionally click **Edit Request**:

     <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/dhl-tem-img9.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=b06366d43d8bf72162ccd7cc57adabf4" alt="Request" width="1917" height="824" data-path="ai-for-service/integrations/actions/images/dhl-tem-img9.png" />

     Click **+Add Response**:

     <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/dhl-tem-img10.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=c30262114caa23c3de7307b88ef5478b" alt="Response" width="1911" height="907" data-path="ai-for-service/integrations/actions/images/dhl-tem-img10.png" />

     **Sample Response:**

     ```json theme={null}
     {
       "locations": [
         {
           "url": "/locations/HYD102",
           "name": "Madhapur Office, HYDERABAD",
           "distance": 1076,
           "place": {
             "address": {
               "countryCode": "IN",
               "postalCode": "500081",
               "addressLocality": "HYDERABAD",
               "streetAddress": "H.No.2-52/1, Plot No.12 Opp Kasanigr Hotel,"
             },
             "geo": { "latitude": 17.441049, "longitude": 78.392052 }
           },
           "serviceTypes": [
             "express:drop-off-easy",
             "express:drop-off",
             "express:pick-up"
           ]
         }
       ]
     }
     ```

   * **getLocationsbyCoordinatesMessage** - Message node to display results.

3. Click **Train**, then **Talk to Bot** to test.

4. Follow prompts to find locations.

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/dhl-action-img11-tem-img2.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=0a5a649b373e597303aff68abd7acbf5" alt="VA console prompt" width="1072" height="907" data-path="ai-for-service/integrations/actions/images/dhl-action-img11-tem-img2.png" />

5. Click and expand the desired result to view location details.

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/dhl-action-img12-tem-img4.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=74e8d3366d9430a26ae6ada5fcf31cd4" alt="View location details" width="1469" height="841" data-path="ai-for-service/integrations/actions/images/dhl-action-img12-tem-img4.png" />
