14.5 Test your Offer Activity using the API

14.5.1 Work with the Offer Decisioning API using Postman

Download this Postman Collection for Offer Decisioning to your desktop and unzip it. You’ll then have this:

OD API

You now have this file on your desktop:

  • _Module 14- Decisioning Service.postman_collection.json

In Exercise 3.3.3 - Postman authentication to Adobe I/O you installed Postman. You’ll need to use Postman again for this exercise.

Open Postman. Click Import.

Adobe I/O New Integration

Click on Upload files.

Adobe I/O New Integration

Select the file _Module 14- Decisioning Service.postman_collection.json and click Open.

Adobe I/O New Integration

You’ll then have this collection available in Postman.

Adobe I/O New Integration

You now have everything you need in Postman to start interacting with Adobe Experience Platform through the APIs.

14.5.1.1 List Containers

Click to open the request GET - List Containers.

Under Params, you’ll see this:

  • property: _instance.parentName==aepenablement

In that parameter, aepenablement is the name of the sandbox that is used in Adobe Experience Platform. The sandbox you should use is --aepSandboxId--. Replace the text aepenablement by --aepSandboxId--.

After replacing the sandbox name, click Send.

OD API

This is the response, which shows the offer container for the sandbox that you specified. Please copy the container instanceId as indicated below and write it down in a text file on your computer. You’ll need to use this container instanceId for the next exercise!

OD API

14.5.1.2 List Placements

Click to open the request GET - List Placements. Click Send.

OD API

You’re now seeing all available placements in your offer container. The placements you’re seeing were defined in the Adobe Experience Platform UI, as you could see in Exercise 14.1.3.

OD API

14.5.1.3 List Decision Rules

Click to open the request GET - List Decision Rules. Click Send.

OD API

In the response, you’ll see the Decision Rules that you defined in the Adobe Experience Platform UI, as you could see in Exercise 14.1.4.

OD API

14.5.1.4 List Personalized Offers

Click to open the request GET - List Personalized Offers. Click Send.

OD API

In the response, you’ll see the Personalized Offers that you defined in the Adobe Experience Platform UI in Exercise 14.2.1.

OD API

14.5.1.5 List Fallback Offers

Click to open the request GET - List Fallback Offers. Click Send.

OD API

In the response, you’ll see the Fallback Offer that you defined in the Adobe Experience Platform UI in Exercise 14.2.2.

OD API

14.5.1.6 List Collections

Click to open the request GET - List Collections.

OD API

In the response, you’ll see the Collection that you defined in the Adobe Experience Platform UI in Exercise 14.2.3.

OD API

14.5.1.7 List Activities

Click to open the request GET - List Activities.

OD API

In the response, you’ll see the Activity that you defined in the Adobe Experience Platform UI in Exercise 14.2.4.

In order to send the next API requests, you now need to search for and then copy the field @id for your Offer Activity ID.

OD API

You can see the Offer Activity ID in the above response, or you can take it from the Adobe Experience Platform UI as indicated below.

OD API

Next, edit your Postman environment.

OD API

Create the variable OFFER_ACTIVITY_ID and assign the value of your Offer Activity ID to it. Click Update to save your changes.

OD API

14.5.1.8 Get Offers by Activity Id

Click to open the request GET - Get Offers by Activity Id.

OD API

In the response, you’ll then see the offers that are part of your activity.

OD API

Click to open the request POST - Get Offers for Customer Profile. With this request, you’re able to enter for instance, the email address of a customer to retrieve the offer that should be presented to that customer.

OD API

Go to Body and enter the email address of the customer for whom you’d like to request an offer. Click Send.

OD API

You’ll then get the response from Offer Decisioning with the id’s of the personalized offer and fallback offer. If you need more detail, continue to the next request.

OD API

14.5.1.9 Get Detailed Offers for Customer Profile

Click to open the request POST - Get Detailed Offers for Customer Profile. This request is similar to the previous one, but will actually return details like image URLs, text etc.

OD API

For this request, similar to the previous exercise which has similar requirements, you need to provide the values for xdm:placementId and xdm:activityId to retrieve the specific offer details for a customer.

The field xdm:activityId is already populated as the result of a previous request you sent, after which you stored the key OFFER_ACTIVITY_ID in your Postman environment.

The field xdm:placementId needs to be filled out. You can retrieve that in the Adobe Experience Platform UI, as indicated below. In the below example, you can see the placementId for the placement Web - Image.

OD API

Go to Body and enter the email address of the customer for whom you’d like to request an offer. Click Send.

OD API

Finally, you’ll then see the result of what kind of personalized offer and what assets need to be displayed to this customer.

OD API

14.5.2 Use the Offer Decisioning API to showcase offers on Xray

In the previous exercise you used the API to retrieve information from Adobe Experience Platform and Offer Decisioning. Let’s now have a look at a practical example.

You’ve seen the Xray panel on the website before. The Xray panel is using the Adobe Experience Platform API’s to retrieve information on every payload. Let’s now add the response from the Offer Decisioning API on Xray.

In order to make this possible, you’ll need three values:

  • Offer Decisioning Container ID
  • Offer Decisioning Placement ID
  • Offer Decisioning Activity ID

Where can you find these values?

14.5.2.1 Offer Decisioning Container ID

The container instanceId was returned by the first API call you sent as part of this exercise. Scroll back up you see the List Containers step. Follow the instructions there to collect the container instanceId.

The format of the container instanceId looks like this: 02068be3-17ae-3ca6-bed6-0daf0084c5a1 and it was part of the output of the List Containers request:

OD API

14.5.2.2 Offer Decisioning Placement ID

The Offer Placement ID identifies the location and type of asset that is required. For instance, the hero image on the Luma website homepage corresponds with the Offer Placement ID for Web - Image.

WebSDK

To find the Offer Placement ID for Web - Image go to https://platform.adobe.com.

Next, go to Offers and then to Placements. Click the Web - Image placement to see its details.

WebSDK

As you can see in the above image, in this example the Offer Placement ID is xcore:offer-placement:127075c49bb0df30. Write down the Offer Placement ID for your placement for Web - Image as you’ll need it in the next exercise.

14.5.2.3 Offer Decisioning Activity ID

The Offer Activity ID identifies which combination of Personalized Offers and Fallback Offer you’d like to use. In the previous exercise, you created your own Offer Activity and named it ldap - Luma Offer Activity.

To find the Offer Activity ID for your ldap - Luma Offer Activity, go to https://platform.adobe.com.

Next, go to Activities and click to select your Offer Activity, which is named ldap - Luma Offer Activity.

WebSDK

As you can see in the above image, in this example the Offer Activity ID is xcore:offer-activity:1272b0c7aee6156b. Write down the Offer Activity ID for your activity ldap - Luma Offer Activity as you’ll need it in the next exercise.

14.5.2.4 Update your Enablement Configuration ID

Before you can test your end-to-end demonstration, you’ll need to update your Configuration ID settings and update the fields for Offer Decisioning Container ID, Offer Decisioning Placement ID and Offer Decisioning Activity ID on the Update Configuration ID page of the demo website.

Go to https://public.aepdemo.net/admin_configuration_update.html.

You’ll then see this:

Launch Setup

Enter your Configuration ID and then click Load Configuration. You’ll see your Configuration ID values being loaded.

Launch Setup

Scroll down until you see the fields Offer Decisioning Container ID, Offer Decisioning Placement ID and Offer Decisioning Activity ID.

Launch Setup

You now need to enter the values for these three fields. You collected these values a couple of minutes ago in the previous step.

Launch Setup

Next, on the Update Configuration ID page, scroll down and click Update Configuration ID.

Launch Setup

After this change, the Offer Decisioning API response will be showcased on Xray!

14.5.2 Text Xray

14.5.2.1 Load website and brand

Open a new, clean incognito browser window and go to https://public.aepdemo.net.

You’ll then see this.

Launch Setup

Enter your Configuration ID and click Load Configuration. Your configuration is then loaded.

Launch Setup

Scroll down and click Save Configuration.

Launch Setup

You’ll then be redirected to the Admin homepage. Go to Select LDAP. Select your LDAP and click Save.

Launch Setup

You’ll then be redirected to the Admin homepage. Go to Select Brand and select the brand Luma, click Save.

Launch Setup

You’ll then be redirected to the Admin homepage. Click the Luma logo.

Launch Setup

14.5.2.2 Customer browses the website

You’ll then see the Luma homepage. You should immediately see your hero image change, and you should see the Fallback Offer that was defined as part of your Offer Activity, just like in the previous exercise. Additionally, when you open the Xray panel and have a look at the Offer Decisioning panel, you’ll now also see the applicable offer being displayed there.

It’s important to understand the difference:

  • the hero image in the website is being delivered by Web SDK, thanks to the integration between Web SDK, Edge and Offer Decisioning
  • the Xray panel, and the offer being shown on Xray, is made possible by consuming the Offer Decisioning APIs

This means that there are two ways of getting the offer in the context where it is needed, which offers you a lot of flexibility!

Launch Setup

Go to the page Login/Register. Fill out the fields and then click CREATE ACCOUNT to create your account.

Launch Setup

As part of the configuration of your Personalized Offers, you defined offers for either male customers or female customers. Based on the gender selection you made on the Login/Register page, you’ll now see another offer on the Luma homepage. This time it isn’t a Fallback Offer anymore, but instead a Personalized Offer. You can now again see the same offer on the hero image and on Xray.

In this example, the gender selection is male. For male customers, the highest priority offer is the offer for the Zeppelin Yoga Pant.

Launch Setup

Thanks to the integration between Web SDK and Adobe Experience Platform, offers can be delivered in a nice and easy way, with a limited amount of configuration.

You’ve now completed this exercise.

Next Step: 14.6 Test your Offer Activity using Journey Orchestration

Go Back to Module 14

Go Back to All Modules

On this page

Adobe Summit Banner

A virtual event April 27-28.

Expand your skills and get inspired.

Register for free
Adobe Summit Banner

A virtual event April 27-28.

Expand your skills and get inspired.

Register for free