# Direct InApp (SDK-less)

Nexx360 Direct InApp provides a lightweight, SDK-less integration for in-app header bidding. Unlike the standard `/inapp` endpoint that requires the Prebid Mobile SDK, Direct InApp uses a simple HTTP GET request that returns targeting key-values ready to be passed to Google Ad Manager.

## How It Works

1. **Your app calls Nexx360** via a GET request with your tag ID (or placement), bundle, and ad sizes
2. **Nexx360 runs a server-side auction** across all configured SSPs
3. **Nexx360 returns targeting key-values** (`hb_pb`, `hb_bidder`, etc.)
4. **Your app sets these key-values as custom targeting** on the Google Ad Manager ad request
5. **Google Ad Manager** evaluates the bid against its own demand and serves the winning ad

{% hint style="info" %}
The Direct InApp call **must be made before** the Google Ad Manager ad request so that the targeting key-values are available when the ad is loaded.
{% endhint %}

## Endpoint

```
GET https://fast.nexx360.io/directinapp
```

## Supported Ad Format

| Format     | Description                                               |
| ---------- | --------------------------------------------------------- |
| **Banner** | Standard mobile formats: 300x250, 320x50, 320x100, 728x90 |

## Query Parameters

| Parameter       | Required | Description                                     | Example             |
| --------------- | -------- | ----------------------------------------------- | ------------------- |
| `tag_id`        | Yes\*    | Nexx360 stored request ID                       | `testnexx`          |
| `placement`     | Yes\*    | Nexx360 placement code (alternative to tag\_id) | `my-placement`      |
| `bundle`        | Yes      | App bundle identifier                           | `com.example.myapp` |
| `sizes`         | Yes      | Comma-separated ad sizes (WxH)                  | `300x250,320x50`    |
| `app_name`      | No       | Application name                                | `My App`            |
| `ifa`           | No       | Advertising ID (IDFA / AAID)                    | `38400000-8cf0-...` |
| `gdpr`          | No       | GDPR applies flag                               | `0` or `1`          |
| `gdpr_consent`  | No       | TCF consent string                              | `CPMeqrn...`        |
| `test`          | No       | Test mode flag                                  | `0` or `1`          |
| `nexx360_debug` | No       | Enable debug output                             | `0` or `1`          |

\* Either `tag_id` or `placement` must be provided.

## Example Request

```
GET https://fast.nexx360.io/directinapp?tag_id=testnexx&bundle=com.example.myapp&sizes=300x250,320x50&ifa=38400000-8cf0-11bd-b23e-10b96e40000d&gdpr=1&gdpr_consent=CPMeqrnPMeqrn...
```

## Response

### Successful Response (200)

```json
{
  "targeting": {
    "hb_env": "mobile-app",
    "hb_cache_id": "testnexx-fast-diap-1234-abc123def456",
    "hb_pb": "1.50",
    "hb_cache_path": "/cache",
    "hb_size": "300x250",
    "hb_bidder": "triplelift",
    "hb_partner": "nexx360",
    "hb_cache_host": "fast.nexx360.io",
    "hb_format": "banner"
  }
}
```

### No Bid Response (204)

When no bids are received, the endpoint returns HTTP 204 with no body.

### Error Response (400)

Returned when required parameters are missing or invalid.

## Targeting Keys Reference

| Key             | Description                      | Example           |
| --------------- | -------------------------------- | ----------------- |
| `hb_env`        | Environment identifier           | `mobile-app`      |
| `hb_cache_id`   | Unique cache ID for ad retrieval | UUID              |
| `hb_pb`         | Price bucket                     | `1.50`            |
| `hb_cache_path` | Cache endpoint path              | `/cache`          |
| `hb_cache_host` | Cache host domain                | `fast.nexx360.io` |
| `hb_size`       | Ad dimensions                    | `300x250`         |
| `hb_bidder`     | Winning SSP/bidder               | `triplelift`      |
| `hb_partner`    | Partner identifier               | `nexx360`         |
| `hb_format`     | Ad format type                   | `banner`          |

## Privacy & Consent

GDPR consent is supported via the `gdpr` and `gdpr_consent` query parameters:

```
&gdpr=1&gdpr_consent=BOEFEAyOEFEAyAHABDENAI4AAAB9vABAASA
```

{% hint style="info" %}
When `gdpr=1` is set without a consent string, personalized ads will not be served.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.nexx360.io/integration-methods/direct-inapp-sdkless.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
