12.2 Define an External Data Source

In this exercise, you’ll create a custom External Data Source by making use of Journey Orchestration in combination with Adobe Experience Platform.

Go to https://experience.adobe.com/

You’ll see the Adobe Experience Cloud homepage.

Demo

Click on Journey Orchestration.

Demo

Next, you’ll see the Journey Orchestration homepage.

Demo

In the menu, click on Data Sources.

Demo

You’ll then see the Data Sources list.

Demo

Click Add to start adding your data source.

Demo

You’ll see an empty data source popup.

Demo

Before you can start configuring this, you’ll need an account with the Open Weather Map service. Follow these steps to create your account and get your API key.

Go to https://openweathermap.org/.

WeatherMap

On the homepage, click Sign Up.

WeatherMap

You’ll then see the Sign Up-form.

WeatherMap

Fill out the details.

WeatherMap

Click Create Account.

WeatherMap

You’ll then be redirected to your Account Page.

WeatherMap

In the menu, click API Keys to retrieve your API Key, which you’ll need to setup your custom External Data Source.

WeatherMap

In this example, the API Key is b2c4c36b6bb59c3458d6686b05311dc3.

You can find the API Documentation for the Current Weather here.

In our use-case, we’ll implement the connection with Open Weather Map based on the city the customer is in.

WeatherMap

Go back to Journey Orchestration, to your empty External Data Source popup.

Demo

As a Name for the Data Source, use weatherApiLdap and replace Ldap with your LDAP. In this example, the Data Source Name is weatherApiVangeluw.

Set Description to: Access to the Open Weather Map.

The URL for the Open Weather Map API is: http://api.openweathermap.org/data/2.5/weather?units=metric

Demo

Next, you need to select the Authentication to use.

Use these variables:

Field Value
Type API key
Name APPID
Value your API Key
Location Query Parameter

Demo

Finally, you need to define a FieldGroup, which is basically the request you’ll be sending to the Weather API. In our case, we want to use the name of the City to request the Current Weather for that City.

Demo

According to the Weather API Documentation, we need to send a parameter q=City.

Demo

In order to match the expected API Request, configure your FieldGroup as follows:

IMPORTANT

The Field group name has to be unique, please use this naming convention: WeatherByCityLdap so in this case, the name should be WeatherByCityVangeluw

Demo

For the Response Payload, you need to paste an example of the Response that will be sent by the Weather API.

You can find the expected API JSON Response on the API Documentation page here.

Demo

Or you can copy the JSON Response from here:

{"coord": { "lon": 139,"lat": 35},
  "weather": [
    {
      "id": 800,
      "main": "Clear",
      "description": "clear sky",
      "icon": "01n"
    }
  ],
  "base": "stations",
  "main": {
    "temp": 281.52,
    "feels_like": 278.99,
    "temp_min": 280.15,
    "temp_max": 283.71,
    "pressure": 1016,
    "humidity": 93
  },
  "wind": {
    "speed": 0.47,
    "deg": 107.538
  },
  "clouds": {
    "all": 2
  },
  "dt": 1560350192,
  "sys": {
    "type": 3,
    "id": 2019346,
    "message": 0.0065,
    "country": "JP",
    "sunrise": 1560281377,
    "sunset": 1560333478
  },
  "timezone": 32400,
  "id": 1851632,
  "name": "Shuzenji",
  "cod": 200
}

Copy the above JSON Response to your clipboard, then go to your custom Data Source configuration screen.

Click the Edit Payload icon.

Demo

You’ll see a popup where you now have to paste the above JSON Response.

Demo

Paste your JSON Response.

Demo

Click Save.

Demo

Your custom Data Source configuration is now complete. Scroll up and click Save.

Demo

Your Data Source has now been created successfully and is part of the Data Sources list.

Demo

Next Step: 12.3 Define a Custom Action

Go Back to Module 12

Go Back to All Modules

On this page