Ad Tag API (UAS)

Document created by pubmatic-archivist on Mar 27, 2017Last modified by catherine.racette on Feb 6, 2018
Version 7Show Document
  • View in full screen mode


The Ad Tag API allows you to generate the Ad Tag based on given parameters.

For more information about UAS Inventory Management Services APIs, refer to Inventory Management Services (UAS) 

Supported Operations

Service Name: /adtags/


Method PathHTTP Method TypeDescriptionLink to Definition

Generates an Ad Tag based on parameters (Ad Unit Id and Ad Format Id).

Supported Ad Unit Formats:

  • 3 = Banner/Rich Media
  • 12 = Native
  • 13 = Video 
Generate an Ad Tag


Generate an Ad Tag



This API enables you to generate an Ad Tag based on the parameters provided.



Request Headers


Header nameType ValueRequiredDescription
Content-TypeStringapplication/jsonYesMedia type for request.

Publisher Token to authenticate and authorize the user calling the Unified Ad Server API. Send the access token generated for authentication at the place of ${access_token} in the request.


For more information about access tokens, refer to Getting Started with PubMatic APIs.

Request Body Parameters


Parameter NameTypeRequiredValidationDescription
adUnitFormatNumericYesShould be valid and exist in the systemAd Unit Format of an ad unit for which the ad tag is generated. You can retrieve Ad Unit Format using Ad Format API.
generateSecureTagBooleanNoDefault is false.Pass true if you would like to have a secure Ad Tag to be set up on secured pages for provided Ad Unit Format; otherwise, pass false.

Request Sample URL 


If the ad unit format is native, the response, along with native ad tag, will have RTB JSON for all native templates associated with that ad unit, as the native template name as key and RTB Request JSON as value.

Sample Response JSON: Non-Native



  "DISPLAY": {
    "tag": {
      "head": "<!-- Part 1 -->\r\n<!-- Head section, should be included only once on a page
-->\r\n<script type='text/javascript'>\r\n   \tvar Phoenix = {};\r\n\tPhoenix.EQ = [];
\r\n\t(function(){\r\n\t\tvar scriptElement = document.createElement('script');\r\n\t\
tscriptElement.async = true;\r\n\t\tscriptElement.type = 'text/javascript';\t\t\r\n\t\
tscriptElement.src = ('https:' == document.location.protocol ? 'https:' : 'http:') +
'//';\r\n\t\tvar node = document.getElementsByTagName
('script')[0];\r\n\t\tnode.parentNode.insertBefore(scriptElement, node);\t\t\t\t\r\n\t})
();\r\n</script>\r\n<!-- Part 2 -->\r\n<!-- AdSlot declaration section, will repeat for
number of slots -->\r\n<script type='text/javascript'>\r\n\tPhoenix.EQ.push
      "body": "<!-- Part 3 -->\r\n<!-- Document Body, This part should be added where
adSlot is expected to render creative  -->\r\n<div id='Div_ID_To_Render_This_Slot'>\r\n\t
<script type='text/javascript'>\r\n\t\tPhoenix.EQ.push(\r\n\t\t\tfunction(){\r\n\t\t\t\

Sample Response JSON: Native


  "NATIVE": {
    "tag": "
    "templateRequestJsonMap": {
      "Test-AdTemplate-001-Apps": "{\"assets\":[{\"id\":1,\"required\":1,\"img\":null,



Unified Ad Server References

Common Request Query Parameters for Web Services

Supported Operations for Filters

HTTP Status Codes

Unified Ad Server Specific Error Codes



Version 9