8.2 Define an external data source
Adobe Journey Optimizer - External Weather API, SMS Action & more - Define an external data source
Last updated
Adobe Journey Optimizer - External Weather API, SMS Action & more - Define an external data source
Last updated
In this exercise, you'll create a custom external data source by making use of Adobe Journey Optimizer.
Login to Adobe Journey Optimizer by going to Adobe Experience Cloud. Click Journey Optimizer.
You'll be redirected to the Home view in Journey Optimizer. First, make sure you're using the correct sandbox. The sandbox to use is called --aepSandboxId--
. To change from one sandbox to another, click on PRODUCTION Prod (VA7) and select the sandbox from the list. In this example, the sandbox is named AEP Enablement FY22. You'll then be in the Home view of your sandbox --aepSandboxId--
.
In the left menu, scroll down and click Configurations. Next, click the Manage button under Data Sources.
You'll then see the Data Sources list. Click Create Data Source to start adding your data source.
You'll see an empty data source popup.
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/. On the homepage, click Sign In.
Click Create an Account.
Fill out the details.
Click Create Account.
You'll then be redirected to your Account Page.
In the menu, click API Keys to retrieve your API Key, which you'll need to setup your custom external data source.
An API Key looks like this: 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.
Go back to Adobe Journey Optimizer, to your empty External Data Source popup.
As a Name for the data source, use --demoProfileLdap--WeatherApi
. In this example, the data source Name is vangeluwWeatherApi
.
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
Next, you need to select the Authentication to use.
Use these variables:
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.
According to the Weather API Documentation, we need to send a parameter q=City
.
In order to match the expected API Request, configure your FieldGroup as follows:
The Field group name has to be unique, please use this naming convention: --demoProfileLdap--WeatherByCity
so in this case, the name should be vangeluwWeatherByCity
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.
Or you can copy the JSON Response from here:
Copy the above JSON Response to your clipboard, then go to your custom data source configuration screen.
Click the Edit Payload icon.
You'll see a popup where you now have to paste the above JSON Response.
Paste your JSON Response, after which you'll see this. Click Save.
Your custom data source configuration is now complete. Scroll up and click Save.
Your data source has now been created successfully and is part of the Data Sources list.
Field | Value |
---|---|
Type
API key
Name
APPID
Value
your API Key
Location
Query Parameter