Ad request API calls

Last updated January 16, 2019

You can place ad tags in your inventory to make ad requestCommunication from a web browser or app to an ad server to display an ad. calls to OpenX, which in turn will send delivery responses to serve ads. Each ad tagA small piece of code that defines the ad space where ads display on a website. It includes parameters that describe the inventory advertising campaigns can target, which may in turn display ads in the ad space. includes parameters describing the inventoryAd space available on a website or app. The basic unit of inventory for OpenX is an ad unit. that advertisers can target.

You can customize ad requests to support your particular implementation using the OpenX ad request API, for example, you might create an ad request to display ads on a mobile device. When a user interacts with your custom application, which has to be configured to communicate with OpenX:

  1. The custom application invokes an ad request for the ad unitThe smallest inventory component that represents the space on a site where ads display., ad unit groupA collection of ad units where related ads display together at the same time., or multiple ad units.

  2. OpenX receives the request, performs ad selection, and returns a structured delivery response in XML, JSON, and JSONP.

  3. The custom application parses the response and renders the selected ad in the appropriate location.

Ad request types

You can make the following types of requests:

  • Standalone. Requests an ad for a single ad unit.

  • Ad unit group. Requests ads for multiple ad units in a single call, referenced by an ad unit group ID. This type of request is required for companion ad placement.

  • Multi-ad unit. Requests ads for multiple ad units in a single call.

You can also request a delivery response for one or more ad units and one or more ad unit groups in a single call to OpenX. For ad request structure examples, see Ad request and response examples and Mobile ad request examples.

Getting started

To configure your custom application:

  1. Create ad units or ad unit groups in the OpenX UI or via the OpenX API.

  2. Implement the appropriate logic and configuration in your custom application to generate OpenX ad requests based on corresponding examples provided in mobile server-to server and video integration instructions.

  3. Configure your custom application with the appropriate ad unit or ad unit group IDs.

  4. Implement the appropriate logic in your application to parse the structured response from OpenX, and then render the ads to the end user.

    Important: These ad requests use a client-side impressionA single display of an ad on a web page, mobile app, or other delivery medium. For deals, impression is a metric to relay the total number of ads that have served. See also billable impression, forecasted impressions. counting mechanism. Your custom application should be configured to handle this operation. To ensure a complete and proper integration, please visit the OpenX Support Community.


Fill out my online form.