---
title: Request and Response Overview
slug: fluid-adserver-api/request-and-response-overview
description: Detailed overview of the ad request/response protocol, batching up to 6 ad units per request, and differences between SPA and Display/Sponsored Brand response formats.
icon: 🔎
docTags: 
createdAt: 2025-02-07T08:52:28.266Z
---

# Ad Request/Response Protocol

The main Pentaleap call is to an adserver-like API is used to request and receive ads from connected demand sources. &#x20;

Ad unit IDs are provided to you from your own Publisher Manager UI. Page context is passed by sharing information such as organic products, search queries and categories as relevant; you may also specify additional products and categories to be in scope for sponsorship.

Sponsored Products and Display/Sponsored Brand ads follow a common request format (and we recommend that they are called together in one request), but have different responses (Display and SPonsored Brand ads have additional assets, associated products etc). Please see [SPA V3](docId\:uM7BURiS8L4NqUVAMmt7R) and [Display V3](docId:0ygBrfYWWibIrJyvu_DaH) for the exact API Specifications.&#x20;

Multiple Ad Units can be called in a single request, and Sponsored Product and Display/Sponsored Brand-type units are also called in the same request format.

For full specification, please check out the API specifications with examples for Sponsored Products and Display Ads in the respective sections.&#x20;

**IMPORTANT**:&#x20;

1. Please check out the [Adserver FAQ](https://docs.pentaleap.com/fluid-adserver-api/faqs-about-the-ad-response) section to understand some common behaviours and rules of the ad response.&#x20;
2. Please see [Integration Best Practices](docId\:Ftw68C7hOtFRQItdgxos7) for advice on calling the APIs generally
3. If your use case includes accessing real-time third party demand, please also see the [Warmup API documentation](https://docs.pentaleap.com/fluid-adserver-api/for-3rd-party-demand-implement-warmup-for-demand-source-calls)
4. For specific use cases and recommendations, please see the[Use Cases and Best Practise](docId\:QDd7CKicgDyPA_zmzA3Q_) section

Here is a sample ad request structure - the response includes both Sponsored Product and Display ads in  **BATCHED** call - i.e. you can call multiple ad units at once, and those ad units can be both SPA and Display/Sponsored Brand ads:

```javascript
{
    "user": {
        "id": "TEST"
    },
    "adUnitContext": { //Page Context goes into adUnitContext - it's shared by all ad units
        "searchQuery": "shampoo",
        "products": [ //ordered list of GTINs/SKUs organically on the page - max 200 (can contain multiple UI pages)
                {
                    "gtin": "ABC"
                },
                {
                    "gtin": "123"
                },
                {
                    "gtin": "DEF123"
                },
                {
                    "gtin": "345"
                },
                {
                    "gtin": "123"
                },
                {
                    "gtin": "..."
                },
                {
                    "gtin": "XYZ"
                }
      ]
    },
    "adUnits": [ //max. 6 per request
        {
            "adUnitId": "[SPA Ad Unit ID 1]"//Search Main Grid
        },
        {
            "adUnitId" : "[Display Ad Unit ID 1]" //Display Above the Fold Search

        }
    ]
}
```

The response returns sponsored and in some cases organic content to be rendered, plus additional information required for rendering and reporting.

Sample response:

```javascript
{
  "adUnits": [
    {
      "adUnitId": "[SPA Ad Unit ID 1]", //returns SPA ad unit information + organic information
      "positions": [
        {
          "gtin": "string",
          "sponsored": false,
          "kind": "string",
          "ext": {
            "attr1": "val1",
            "attr2": "val2"
          }
        },
        {
          "gtin": "string",
          "sponsored": true,
          "kind": "string",
          "beaconUrls": [
            "string"
          ],
          "clickUrls": [
            "string"
          ],
          "ext": {
            "attr1": "val1",
            "attr2": "val2"
          }
        },
        {
            "adUnitId": "[Display Ad Unit ID 1]", //returns Display ad unit information
            "positions": [
                {
                    "banner": {
                        "300x250": {
                            "assetUrl": "linktoasset.com",
                            "clickUrls": [
                                "https://trackerUrl"
                            ],
                            "beaconUrls": [
                                "https://trackerUrl"
                            ],
                            "ext": {
                                "type": "IMAGE"
                            }
                        },
                        "970x250": {
                            "assetUrl": "linktoasset.com",
                            "clickUrls": [
                                "https://trackerUrl"
                            ],
                            "beaconUrls": [
                                "https://trackerUrl"
                            ],
                            "ext": {
                                "type": "IMAGE",
                                "adCopy": "This is an ad copy"
                            }
                        },
                        "dynamic": {
                            "assetUrl": "linktoasset.com",
                            "clickUrls": [
                                "https://trackerUrl"
                            ],
                            "beaconUrls": [
                                "https://trackerUrl"
                            ],
                            "ext": { //Contains additional ad information for rendering display ad
                                "type": "HTML_IMAGE_LINK"
                            }
                        }
                    },
                    "kind": "Display",
                    "targetUrl": "https://pentaleap.com",
                    "sponsored": true
                }
            ]
        }
    ]
}
```



