# 9.6 Test your decision using the API

## 9.6.1 Work with the Offer Decisioning API using Postman

Download [this Postman Collection for Offer Decisioning](https://github.com/AdobePartnerTechnicalServices/aep-quickstart-guide/blob/main/assets/postman/postman_offer-decisioning.zip) to your desktop and unzip it. You'll then have this:

![OD API](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-03087f437b89ae93a6b5c24fcecb28bab62a079e%2Funzip.png?alt=media)

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](https://docs.adobesandbox.com/comprehensive-technical-tutorial-archive/module3/ex3) you installed Postman. You'll need to use Postman again for this exercise.

Open Postman. Click **\[Import]**.

![Adobe I/O New Integration](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-e9bc9644d41a808a25c3ae24b769c1a3877a6089%2Fpostmanui.png?alt=media)

Click on **\[Upload files]**.

![Adobe I/O New Integration](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-b98cd59a534629feeeb38b7f5ad84e49b1fbd2a9%2Fpm1.png?alt=media)

Select the file **\[\_Module 14- Decisioning Service.postman\_collection.json]** and click **\[Open]**.

![Adobe I/O New Integration](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-2f8cfc0b170cfe475e6ff91fc1732e929e60e443%2Fpm2.png?alt=media)

You'll then have this collection available in Postman.

![Adobe I/O New Integration](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-f7ff256fa4625e5f7811afaaae84740ed296d67f%2Fpm3.png?alt=media)

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

### 9.6.1.1 List Containers

Click to open the request **\[GET - List Containers]**.

Under **\[Params]**, you'll see this:

* property: `_instance.parentName==aepenablementfy22`

In that parameter, **\[aepenablementfy22]** is the name of the sandbox that is used in Adobe Experience Platform. The sandbox you should use is `--aepSandboxId--`. Replace the text **\[aepenablementfy22]** by `--aepSandboxId--`.

After replacing the sandbox name, click **\[Send]**.

![OD API](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-9e45618c3ee3bcdf7b6b6c6233b8d2b4f90c5f14%2Fapi2.png?alt=media)

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](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-58f04966f087f06bd17045c970cf079f3f429315%2Fapi3.png?alt=media)

### 9.6.1.2 List Placements

Click to open the request **\[GET - List Placements]**. Click **\[Send]**.

![OD API](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-ed6f147d0c6dfb51963e45bc7a05065d5530a6c7%2Fapi4.png?alt=media)

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 9.1.3](https://docs.adobesandbox.com/comprehensive-technical-tutorial-archive/module9/ex1).

![OD API](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-1a7e8e4935a994ee056abe98527516b9f64d85aa%2Fapi5.png?alt=media)

### 9.6.1.3 List Decision Rules

Click to open the request **\[GET - List Decision Rules]**. Click **\[Send]**.

![OD API](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-d794703e12ee05be8dbb8f3c69825639b9452958%2Fapi6.png?alt=media)

In the response, you'll see the Decision Rules that you defined in the Adobe Experience Platform UI, as you could see in [Exercise 9.1.4](https://docs.adobesandbox.com/comprehensive-technical-tutorial-archive/module9/ex1).

![OD API](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-70d67a2beca877a495b00c1a32e9ca7fec9e9bca%2Fapi7.png?alt=media)

### 9.6.1.4 List Personalized Offers

Click to open the request **\[GET - List Personalized Offers]**. Click **\[Send]**.

![OD API](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-cbe991f3a894c83b3900f9c09cc0f97ee15b3bda%2Fapi8.png?alt=media)

In the response, you'll see the Personalized Offers that you defined in the Adobe Experience Platform UI in [Exercise 9.2.1](https://docs.adobesandbox.com/comprehensive-technical-tutorial-archive/module9/ex2).

![OD API](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-d090f61b4679ab918bd9bc34819bcc9c02d1962a%2Fapi9.png?alt=media)

### 9.6.1.5 List Fallback Offers

Click to open the request **\[GET - List Fallback Offers]**. Click **\[Send]**.

![OD API](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-b4230d042902b78f258fb7f20039b54ac510b181%2Fapi10.png?alt=media)

In the response, you'll see the Fallback Offer that you defined in the Adobe Experience Platform UI in [Exercise 9.2.2](https://docs.adobesandbox.com/comprehensive-technical-tutorial-archive/module9/ex2).

![OD API](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-0559e2e3bd00d925197c1f5670d284f94257d2aa%2Fapi11.png?alt=media)

### 9.6.1.6 List Collections

Click to open the request **\[GET - List Collections]**.

![OD API](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-600c68947ad46c6727454de4607f421edc209eaa%2Fapi12.png?alt=media)

In the response, you'll see the Collection that you defined in the Adobe Experience Platform UI in [Exercise 9.2.3](https://docs.adobesandbox.com/comprehensive-technical-tutorial-archive/module9/ex2).

![OD API](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-7826fee948e9215b7c13a1fa09b54cb767bc3a35%2Fapi13.png?alt=media)

### 9.6.1.7 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](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-8902b3686e03ec7278f6814a96d5cdbc1d7b4cfe%2Fapi23.png?alt=media)

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]** needs to be filled out. You can retrieve that in the Adobe Experience Platform UI, as indicated below.

![OD API](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-7c48517cf21346ebaec8fc363af5ac2f7eeec012%2Factivityid.png?alt=media)

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](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-5129357c95377473cce76028e41a8088cbca6a96%2Fplacementid.png?alt=media)

Go to **\[Body]** and enter the email address of the customer for whom you'd like to request an offer. Click **\[Send]**.

![OD API](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-9ea5592db3c29e011c762b0de25ab2d73c7eaeb5%2Fapi24.png?alt=media)

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](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-5b80e18a388e13b75ecb251c3ff975cd37fd3e28%2Fapi25.png?alt=media)

You've now completed this exercise.
